:root {
  --bg: #060d14;
  --bg-2: #0a1622;
  --card: rgba(255, 255, 255, 0.045);
  --card-2: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #eaf3f9;
  --muted: #8ea3b6;
  --muted-2: #647a8e;
  --coral: #ff9f6e;
  --cyan: #63d8ff;
  --pink: #ff9fc4;
  --gold: #f7c96b;
  --green: #63e2a4;
  --danger: #ff6b6b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 20px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  background:
    radial-gradient(1100px 720px at 12% -8%, rgba(33, 94, 132, 0.32), transparent 55%),
    radial-gradient(900px 680px at 108% 2%, rgba(119, 49, 64, 0.28), transparent 52%),
    radial-gradient(900px 900px at 50% 120%, rgba(24, 76, 92, 0.25), transparent 60%),
    var(--bg);
  overflow-x: hidden;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.aurora {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.aurora-a {
  width: 420px;
  height: 420px;
  left: -140px;
  top: 12%;
  background: #1e6d8a;
}

.aurora-b {
  width: 380px;
  height: 380px;
  right: -120px;
  top: 45%;
  background: #7a3c4c;
}

.shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px calc(96px + env(safe-area-inset-bottom));
}

/* ---------------------------------------------------------- top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0 12px;
  background: linear-gradient(to bottom, #060d14 70%, rgba(6, 13, 20, 0.98));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 15px;
  color: #07131b;
  background:
    radial-gradient(90% 90% at 20% 10%, #f8d9c2 0%, transparent 55%),
    linear-gradient(135deg, var(--coral), #ffc68f 48%, var(--cyan));
  box-shadow: 0 10px 24px rgba(255, 159, 110, 0.2);
}

.brand-text {
  min-width: 0;
}

.brand-text h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.brand-text p {
  margin: 1px 0 0;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--muted-2);
  white-space: nowrap;
}

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

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.live-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(99, 226, 164, 0.5);
  animation: pulse 2.2s infinite;
}

.live-pill.off i {
  background: var(--danger);
  animation: none;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(99, 226, 164, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(99, 226, 164, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 226, 164, 0); }
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  transition: transform 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover,
.icon-btn:active {
  color: var(--text);
  border-color: var(--line-strong);
  transform: rotate(-12deg);
}

/* ---------------------------------------------------------- account switch */

.accountbar {
  display: flex;
  gap: 8px;
  padding: 2px 0 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.accountbar::-webkit-scrollbar {
  display: none;
}

.bot-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 0 auto;
  min-width: 130px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.bot-pill:hover {
  border-color: var(--line-strong);
}

.bot-pill.active {
  color: var(--text);
  border-color: var(--accent, var(--cyan));
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent, var(--cyan)) 45%, transparent);
}

.bot-pill .bot-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent, var(--cyan));
  box-shadow: 0 0 10px var(--accent, var(--cyan));
}

.bot-pill .bot-pill-sub {
  color: var(--muted-2);
  font-size: 10px;
  margin-left: auto;
}

/* ---------------------------------------------------------- layout */

.app {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: enter 0.28s ease both;
}

@keyframes enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 2px 0;
}

.section-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.section-sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.028));
  box-shadow: var(--shadow);
  padding: 18px;
  overflow: hidden;
}

.card + .card { margin-top: 0; }

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .grid.two {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------------------------------------------------------- bot cards */

.bot-card {
  position: relative;
  padding-top: 22px;
}

.bot-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent 85%);
  opacity: 0.9;
}

.bot-card::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -70px;
  top: -80px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 18%, transparent), transparent 68%);
  pointer-events: none;
}

.bot-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bot-avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  font-size: 19px;
  font-weight: 800;
  color: #06121a;
  background: linear-gradient(140deg, var(--accent), rgba(255, 255, 255, 0.75));
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 25%, transparent);
  flex: 0 0 auto;
}

.bot-meta {
  min-width: 0;
  flex: 1;
}

.bot-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 16px;
  font-weight: 700;
}

.bot-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.bot-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.stat {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.16);
}

.stat-label {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.stat-value {
  margin-top: 3px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.stat-unit {
  margin-left: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

/* ---------------------------------------------------------- badges / dots */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.badge.accent {
  color: var(--accent, var(--cyan));
  border-color: color-mix(in srgb, var(--accent, var(--cyan)) 35%, transparent);
  background: color-mix(in srgb, var(--accent, var(--cyan)) 10%, transparent);
}

.badge.work {
  color: var(--gold);
  border-color: rgba(247, 201, 107, 0.35);
  background: rgba(247, 201, 107, 0.09);
}

.badge.current {
  color: var(--green);
  border-color: rgba(99, 226, 164, 0.32);
  background: rgba(99, 226, 164, 0.08);
}

.badge.persona-whale {
  color: var(--cyan);
  border-color: rgba(99, 216, 255, 0.32);
  background: rgba(99, 216, 255, 0.08);
}

.badge.persona-nagisa {
  color: var(--pink);
  border-color: rgba(255, 159, 196, 0.34);
  background: rgba(255, 159, 196, 0.08);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
  flex: 0 0 auto;
}

.dot.online { background: var(--green); box-shadow: 0 0 8px rgba(99, 226, 164, 0.7); }
.dot.offline { background: #5b6b7a; }

/* ---------------------------------------------------------- feed */

.feed {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feed-item {
  display: flex;
  gap: 11px;
  padding: 11px 2px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.065);
}

.feed-item:last-child { border-bottom: 0; }

.feed-rail {
  width: 3px;
  border-radius: 3px;
  background: var(--accent, var(--cyan));
  opacity: 0.75;
  flex: 0 0 auto;
}

.feed-body {
  min-width: 0;
  flex: 1;
}

.feed-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10.5px;
}

.feed-meta strong {
  color: var(--text);
  font-weight: 600;
}

.feed-text {
  color: #cfdeea;
  font-size: 12.5px;
  line-height: 1.55;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.feed-time {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 10px;
  white-space: nowrap;
}

/* ---------------------------------------------------------- conversation list */

.conv-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.conv {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.028);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.conv:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.045);
  transform: translateY(-1px);
}

.conv.active {
  border-color: rgba(99, 216, 255, 0.4);
  background: rgba(99, 216, 255, 0.055);
}

.conv-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  flex: 0 0 auto;
  font-size: 15px;
  font-weight: 700;
  color: #06121a;
  background: linear-gradient(140deg, var(--accent, var(--cyan)), rgba(255, 255, 255, 0.7));
}

.conv-main {
  min-width: 0;
  flex: 1;
}

.conv-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
}

.conv-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.conv-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.conv-tags .badge {
  padding: 2px 7px;
  font-size: 9px;
}

.conv-snippet {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex: 0 0 auto;
}

.conv-time {
  color: var(--muted-2);
  font-size: 10px;
  white-space: nowrap;
}

.conv-counts {
  color: var(--muted-2);
  font-size: 10px;
  white-space: nowrap;
}

/* ---------------------------------------------------------- chat */

.chat-head {
  position: sticky;
  top: 76px;
  z-index: 18;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -8px 2px;
  padding: 10px 8px 11px;
  border-radius: 0 0 16px 16px;
  background: linear-gradient(to bottom, #060d14 72%, rgba(6, 13, 20, 0.97));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.chat-back {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
}

.chat-title {
  min-width: 0;
  flex: 1;
}

.chat-title h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
}

.chat-scroll {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 4px 2px 8px;
}

.msg {
  display: flex;
  flex-direction: column;
  max-width: 86%;
  gap: 3px;
  animation: enter 0.22s ease both;
}

.msg.user {
  align-self: flex-end;
  align-items: flex-end;
}

.msg.bot {
  align-self: flex-start;
  align-items: flex-start;
}

.bubble {
  padding: 10px 13px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
}

.msg.user .bubble {
  color: #241208;
  background: linear-gradient(135deg, #ffb184, #ff8d63);
  border-bottom-right-radius: 6px;
  box-shadow: 0 8px 20px rgba(255, 141, 99, 0.16);
}

.msg.bot .bubble {
  color: #e6f1f8;
  background: linear-gradient(155deg, #172a3a, #101d29);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 6px;
}

.msg-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-2);
  font-size: 9.5px;
  padding: 0 4px;
}

.msg-images {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.msg-img {
  display: block;
  width: 140px;
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.load-more {
  align-self: center;
  margin: 6px auto;
}

.system-note {
  align-self: center;
  max-width: 92%;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  text-align: center;
}

/* ---------------------------------------------------------- work */

.work-hero {
  display: grid;
  gap: 16px;
}

.token-big {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  line-height: 1;
}

.token-big strong {
  font-size: clamp(34px, 8vw, 54px);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, #ffe9c7, var(--gold) 55%, #ff9f6e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}

.token-big span {
  color: var(--muted);
  font-size: 12px;
  padding-bottom: 8px;
}

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

.work-stats .stat-value {
  font-size: 16px;
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 122px;
  padding-top: 8px;
}

.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 100%;
  max-width: 34px;
  min-height: 3px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(to top, rgba(247, 201, 107, 0.15), var(--gold));
  transition: height 0.4s ease;
}

.chart-col.today .chart-bar {
  background: linear-gradient(to top, rgba(255, 159, 110, 0.2), var(--coral));
}

.chart-label {
  color: var(--muted-2);
  font-size: 9px;
  white-space: nowrap;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.task {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.14);
  padding: 11px 12px;
}

.task-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.task-title {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #dce9f2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.task-tokens {
  flex: 0 0 auto;
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 9.5px;
}

.task-summary {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* ---------------------------------------------------------- plugins */

.plugin {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.028);
}

.plugin + .plugin { margin-top: 7px; }

.plugin-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 12px;
  color: var(--cyan);
  background: rgba(99, 216, 255, 0.08);
  border: 1px solid rgba(99, 216, 255, 0.14);
}

.plugin-main {
  flex: 1;
  min-width: 0;
}

.plugin-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.plugin-desc {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 26px;
  flex: 0 0 auto;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.switch span::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #8698a8;
  transition: transform 0.18s ease, background 0.18s ease;
}

.switch input:checked + span {
  background: rgba(99, 226, 164, 0.2);
  border-color: rgba(99, 226, 164, 0.5);
}

.switch input:checked + span::after {
  transform: translateX(18px);
  background: var(--green);
}

.switch input:disabled + span {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------------------------------------------------------- memory */

.memory-current {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 4px 0 14px;
}

.memory-current strong {
  font-size: clamp(38px, 10vw, 62px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, #dff5ff, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.memory-current span {
  color: var(--muted);
  font-size: 12px;
  padding-bottom: 6px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 14px;
}

.field label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.rounds-input {
  width: 108px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.rounds-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(99, 216, 255, 0.12);
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.preset {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.preset:hover,
.preset.active {
  color: var(--text);
  border-color: var(--cyan);
  background: rgba(99, 216, 255, 0.1);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.07);
  margin-top: 14px;
}

.switch-row .label {
  font-size: 12px;
}

.switch-row .hint {
  color: var(--muted-2);
  font-size: 10px;
  margin-top: 2px;
}

/* ---------------------------------------------------------- personas */

.persona-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.persona-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 11.5px;
}

.persona-chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pc, var(--cyan));
}

.persona-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.07);
}

.persona-row:last-child { border-bottom: 0; }

.persona-row .persona-main {
  flex: 1;
  min-width: 0;
}

.persona-row .persona-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
}

.persona-row .persona-sub {
  color: var(--muted-2);
  font-size: 10px;
  margin-top: 2px;
}

.persona-select {
  height: 36px;
  min-width: 96px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  outline: none;
}

/* ---------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.btn:active { transform: translateY(0); }

.btn.primary {
  color: #04131b;
  border-color: transparent;
  background: linear-gradient(135deg, var(--cyan), #9be9ff);
  box-shadow: 0 8px 20px rgba(99, 216, 255, 0.18);
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  color: #2a0b0b;
  border-color: transparent;
  background: linear-gradient(135deg, #ff8b8b, #ff6b6b);
}

.btn.small {
  height: 32px;
  padding: 0 11px;
  font-size: 11px;
  border-radius: 10px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ---------------------------------------------------------- empty / loading */

.empty {
  padding: 34px 18px;
  text-align: center;
  color: var(--muted);
}

.empty .empty-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 10px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted-2);
}

.empty h3 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 14px;
}

.empty p {
  margin: 0;
  font-size: 11.5px;
}

.skeleton {
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04));
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* ---------------------------------------------------------- tabbar */

.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  width: min(calc(100% - 24px), 620px);
  padding: 7px 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background: rgba(10, 20, 30, 0.82);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 0 4px;
  border-radius: 15px;
  color: var(--muted-2);
  text-decoration: none;
  font-size: 9.5px;
  transition: color 0.16s ease, background 0.16s ease;
}

.tabbar a svg {
  width: 20px;
  height: 20px;
}

.tabbar a.active {
  color: var(--cyan);
  background: rgba(99, 216, 255, 0.075);
}

.tabbar a:active {
  background: rgba(255, 255, 255, 0.06);
}

/* ---------------------------------------------------------- toast / dialogs */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(98px + env(safe-area-inset-bottom));
  z-index: 60;
  transform: translate(-50%, 16px);
  max-width: calc(100% - 40px);
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(16, 30, 42, 0.94);
  color: var(--text);
  font-size: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  border-color: rgba(255, 107, 107, 0.4);
  color: #ffd6d6;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 8, 13, 0.7);
  backdrop-filter: blur(10px);
}

.overlay[hidden] { display: none; }

.dialog {
  width: min(100%, 360px);
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: #0d1a26;
  box-shadow: var(--shadow);
}

.dialog h2 {
  margin: 0 0 6px;
  font-size: 17px;
}

.dialog p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}

.dialog-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  border-radius: 14px;
  color: var(--cyan);
  background: rgba(99, 216, 255, 0.09);
  border: 1px solid rgba(99, 216, 255, 0.16);
}

.dialog input {
  width: 100%;
  height: 42px;
  margin: 14px 0 10px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font: inherit;
  outline: none;
}

.dialog input:focus {
  border-color: var(--cyan);
}

.dialog .btn {
  width: 100%;
}

.dialog-actions {
  display: flex;
  gap: 9px;
  margin-top: 18px;
}

.dialog-actions .btn {
  flex: 1;
  width: auto;
}

.form-error {
  min-height: 18px;
  margin-top: 8px !important;
  color: var(--danger);
  font-size: 11px !important;
}

/* ---------------------------------------------------------- desktop */

@media (min-width: 760px) {
  .shell {
    padding-left: 24px;
    padding-right: 24px;
  }
  .brand-text h1 { font-size: 20px; }
  .card { padding: 22px; }
  .accountbar { max-width: 520px; }
  .bot-pill { min-width: 180px; }
  .tabbar {
    bottom: 20px;
  }
}

@media (max-width: 380px) {
  .brand-text p { display: none; }
  .live-pill span { display: none; }
  .live-pill { width: 30px; justify-content: center; padding: 0; }
  .tabbar a { font-size: 9px; }
}

/* ---------------------------------------------------------- 群聊自己接话 */

.ac-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.ac-group {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.14);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.ac-group:hover {
  border-color: rgba(99, 216, 255, 0.28);
}

.ac-group input {
  width: 16px;
  height: 16px;
  flex: none;
  accent-color: var(--cyan);
}

.ac-group span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ac-group small {
  color: var(--muted-2);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.ac-skips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

@media (max-width: 600px) {
  .ac-groups { grid-template-columns: minmax(0, 1fr); }
}

