:root {
  --bg: #fff;
  --panel: #fff;
  --header: #f0f2f5;
  --text: #111b21;
  --muted: #667781;
  --icon: #54656f;
  --border: #e9edef;
  --hover: #f5f6f6;
  --active: #f0f2f5;
  --search: #f0f2f5;
  --thread: #efeae2;
  --in: #fff;
  --out: #d9fdd3;
  --chip: #f0f2f5;
  --chip-on: #d8fdd2;
  --chip-on-text: #008069;
  --badge: #25d366;
  --compose: #f0f2f5;
  --menu: #fff;
  --empty: #f0f2f5;
  --shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  --tick: #53bdeb;
  --meta: #667781;
  --date: #fff;
  --system: #fff4c4;
  --info-bg: #f0f2f5;
  --accent: #008069;
  --green: #00a884;
  color-scheme: light;
}

body.dark {
  --bg: #0b141a;
  --panel: #111b21;
  --header: #202c33;
  --text: #e9edef;
  --muted: #8696a0;
  --icon: #aebac1;
  --border: #222d34;
  --hover: #202c33;
  --active: #2a3942;
  --search: #202c33;
  --thread: #0b141a;
  --in: #202c33;
  --out: #005c4b;
  --chip: #202c33;
  --chip-on: #00a884;
  --chip-on-text: #111b21;
  --compose: #202c33;
  --menu: #233138;
  --empty: #222e35;
  --meta: rgba(233, 237, 239, 0.7);
  --date: #182229;
  --system: #182229;
  --info-bg: #111b21;
  --accent: #00a884;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, "Noto Sans", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
[hidden] { display: none !important; }
svg { display: block; }

.wa {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  background: var(--panel);
  min-width: 0;
}
.conversation > .chatbar {
  flex: none;
  z-index: 3;
}

.sidebar {
  width: clamp(320px, 32vw, 480px);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--panel);
  position: relative;
  min-width: 0;
  min-height: 0;
}
.stage {
  flex: 1;
  display: flex;
  min-width: 0;
  min-height: 0;
  background: var(--thread);
}
.topbar {
  height: 60px;
  background: var(--header);
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 12px;
  position: relative;
  flex: none;
}
.top-actions { margin-left: auto; display: flex; gap: 4px; }
.top-actions button, .icon-btn, .chatbar button.tool {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--icon);
  display: grid;
  place-items: center;
}
.top-actions button:hover, .icon-btn:hover, .chatbar button.tool:hover { background: var(--hover); }
.avatar-btn, .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: transparent;
  overflow: hidden;
  flex: none;
}
.avatar.lg { width: 49px; height: 49px; }
.avatar.xl { width: 160px; height: 160px; margin: 28px auto 12px; display: block; }
.avatar svg, .avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.menu .icon-grid { display: grid; grid-template-columns: repeat(4, 40px); gap: 8px; padding: 8px 16px 4px; }
.menu .icon-grid button { width: 40px; height: 40px; padding: 0; border-radius: 50%; overflow: hidden; }

.search { position: relative; padding: 6px 12px 4px; }
.search input, .search-chat input, .field input, .drawer input[type="text"], .drawer input[type="search"] {
  width: 100%;
  height: 35px;
  border: 0;
  border-radius: 8px;
  background: var(--search);
  padding: 0 12px 0 36px;
  outline: none;
}
.search [data-icon] {
  position: absolute;
  left: 22px;
  top: 12px;
  width: 24px;
  height: 24px;
  color: var(--muted);
}
.search-chat {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--header);
}
.search-chat input { padding-left: 12px; flex: 1; }
.search-chat button { border: 0; background: transparent; color: var(--icon); width: 36px; height: 36px; }

.chips { display: flex; gap: 8px; padding: 8px 12px 10px; overflow: auto; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  border: 0;
  background: var(--chip);
  color: var(--muted);
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.chip.on { background: var(--chip-on); color: var(--chip-on-text); }

.list { overflow: auto; flex: 1; min-height: 0; }
.list::-webkit-scrollbar, .thread::-webkit-scrollbar, .info::-webkit-scrollbar, .drawer-body::-webkit-scrollbar { width: 6px; }
.list::-webkit-scrollbar-thumb, .thread::-webkit-scrollbar-thumb, .info::-webkit-scrollbar-thumb, .drawer-body::-webkit-scrollbar-thumb {
  background: rgba(11, 20, 26, 0.2);
  border-radius: 4px;
}
.chat-row, .person-row, .archive-row {
  width: 100%;
  display: grid;
  grid-template-columns: 49px minmax(0, 1fr);
  column-gap: 14px;
  align-items: center;
  padding: 0 0 0 16px;
  height: 72px;
  border: 0;
  background: transparent;
  text-align: left;
  color: inherit;
}
.chat-row:hover, .person-row:hover, .archive-row:hover { background: var(--hover); }
.chat-row.active { background: var(--active); }
.chat-main {
  min-width: 0;
  height: 100%;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 14px;
  gap: 2px;
}
.line { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.name { font-size: 17px; color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.time { font-size: 12px; color: var(--muted); flex: none; }
.time.fresh { color: var(--badge); }
.subline { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: 14px; }
.preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; display: flex; align-items: center; gap: 4px; min-width: 0; }
.preview .who { flex: none; }
.preview .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview.typing { color: var(--accent); }
.badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--badge);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: inline-grid;
  place-items: center;
  flex: none;
}
.mini { color: var(--muted); flex: none; display: inline-flex; }
.empty-list { padding: 48px 24px; text-align: center; color: var(--muted); }

.menu, .popover, .attach-pop, .emoji-pop {
  position: absolute;
  background: var(--menu);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(11, 20, 26, 0.18), 0 12px 28px rgba(11, 20, 26, 0.16);
  z-index: 30;
  border-radius: 4px;
}
.menu { top: 52px; right: 10px; min-width: 196px; padding: 6px 0; z-index: 80; }
.menu button, .popover button, .attach-pop button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 12px 24px;
  font-size: 14.5px;
  color: var(--text);
}
.menu button:hover, .popover button:hover, .attach-pop button:hover { background: var(--hover); }
.menu button.quiet { color: var(--muted); }
.menu button.danger { color: #ea0038; }
.popover { min-width: 180px; padding: 6px 0; position: fixed; }
.attach-pop { bottom: 62px; left: 48px; min-width: 180px; padding: 6px 0; }
.attach-pop button { display: flex; align-items: center; gap: 12px; }
.emoji-pop {
  bottom: 62px;
  left: 12px;
  width: min(360px, calc(100% - 24px));
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  max-height: 240px;
  overflow: auto;
}
.emoji-pop button {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  font-size: 24px;
  border-radius: 8px;
}
.emoji-pop button:hover { background: var(--hover); }

.conversation { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.chatbar { cursor: pointer; }
.chatbar .who { min-width: 0; flex: 1; }
.chatbar .who strong { display: block; font-size: 16px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chatbar .who span { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chatbar .who span.typing { color: var(--accent); }
.here-node {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 0 4px;
  white-space: nowrap;
}
.back { display: none; width: 36px; height: 36px; border: 0; background: transparent; color: var(--icon); }

.thread-wrap { flex: 1; position: relative; min-height: 0; display: flex; }
.thread {
  flex: 1;
  overflow: auto;
  padding: 12px 0 8px;
  background: var(--thread) url("wallpaper.svg");
  min-height: 0;
}
body.dark .thread { background-color: #0b141a; background-blend-mode: soft-light; }
.day {
  width: fit-content;
  margin: 10px auto;
  background: var(--date);
  color: var(--muted);
  box-shadow: var(--shadow);
  border-radius: 8px;
  padding: 5px 12px 6px;
  font-size: 12.5px;
}
.system {
  width: min(460px, 86%);
  margin: 8px auto 12px;
  background: var(--system);
  color: var(--muted);
  text-align: center;
  border-radius: 8px;
  padding: 6px 12px 8px;
  font-size: 12.5px;
  line-height: 18px;
  box-shadow: var(--shadow);
}
.system svg { display: inline-block; vertical-align: -3px; margin-right: 4px; }
.msg { display: flex; padding: 1px 7% 1px 4%; }
.msg:not(.cluster) { margin-top: 3px; }
.msg.out { justify-content: flex-end; padding: 1px 4% 1px 12%; }
.msg.cluster { margin-top: 8px; }
.bubble {
  position: relative;
  max-width: min(620px, 78%);
  background: var(--in);
  border-radius: 7.5px;
  box-shadow: var(--shadow);
  padding: 6px 7px 4px 9px;
  font-size: 14.2px;
  line-height: 19px;
  color: var(--text);
}
.bubble.out { background: var(--out); }
.bubble.tail.in { border-top-left-radius: 0; }
.bubble.tail.out { border-top-right-radius: 0; }
.bubble.tail.in::after, .bubble.tail.out::after {
  content: "";
  position: absolute;
  top: 0;
  width: 8px;
  height: 13px;
}
.bubble.tail.in::after { left: -8px; background: var(--in); clip-path: polygon(100% 0, 0 0, 100% 100%); }
.bubble.tail.out::after { right: -8px; background: var(--out); clip-path: polygon(0 0, 100% 0, 0 100%); }
.sender { font-size: 12.8px; font-weight: 500; line-height: 18px; margin-bottom: 1px; }
.body { white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.body a { color: #027eb5; }
.meta {
  float: right;
  margin-left: 12px;
  margin-top: 6px;
  position: relative;
  top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--meta);
  font-size: 11px;
  line-height: 15px;
  white-space: nowrap;
  user-select: none;
}
.ticks { color: var(--meta); }
.ticks.read { color: var(--tick); }
.ticks.failed { color: #ea0038; }
.bubble.jumbo { background: transparent; box-shadow: none; font-size: 56px; line-height: 1.15; padding: 0 4px; }
.bubble.jumbo.tail::after { display: none; }
.bubble img.photo, .bubble video { display: block; max-width: 330px; width: 100%; border-radius: 6px; cursor: pointer; }
.bubble.has-media {
  display: flex;
  flex-direction: column;
  width: min(340px, 78%);
  padding: 3px 3px 4px;
}
.bubble.has-media img.photo { max-width: none; }
.bubble.has-media .caption { padding: 6px 6px 0; }
.bubble.has-media .meta {
  float: none;
  align-self: flex-end;
  margin: 2px 6px 1px auto;
  top: 0;
}
.quote {
  border-left: 4px solid var(--green);
  background: rgba(11, 20, 26, 0.05);
  border-radius: 6px;
  padding: 4px 8px;
  margin-bottom: 4px;
  cursor: pointer;
  max-width: 100%;
}
body.dark .quote { background: rgba(255, 255, 255, 0.06); }
.quote b { display: block; font-size: 12.5px; color: var(--accent); }
.quote span { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deleted { font-style: italic; color: var(--muted); }
.voice { display: flex; align-items: center; gap: 8px; min-width: 220px; padding: 2px 2px 0; }
.voice .play {
  width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--badge); color: #fff; display: grid; place-items: center; flex: none;
}
.bars { display: flex; align-items: center; gap: 2px; height: 28px; flex: 1; }
.bars i { display: block; width: 3px; border-radius: 2px; background: #8696a0; }
.voice.played .bars i.on, .bars i.on { background: var(--green); }
.voice .dur { font-size: 11px; color: var(--meta); flex: none; }
.typing-row { display: flex; padding: 6px 7% 8px 4%; }
.dots {
  background: var(--in);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  gap: 4px;
  box-shadow: var(--shadow);
}
.dots i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--muted); display: block;
  animation: blink 1.2s infinite;
}
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 60%, 100% { opacity: 0.3; } 30% { opacity: 1; } }

.composer { background: var(--compose); padding: 6px 12px calc(8px + env(safe-area-inset-bottom)); position: relative; flex: none; }
.composer-row, .record-bar { display: flex; align-items: flex-end; gap: 8px; }
.composer-row button, .record-bar button {
  width: 40px; height: 42px; border: 0; background: transparent; color: var(--icon); display: grid; place-items: center; flex: none;
}
#sendBtn.send { color: var(--green); }
#stopBtn { color: #ea0038; }
textarea#input {
  flex: 1;
  resize: none;
  border: 0;
  border-radius: 8px;
  background: var(--panel);
  padding: 10px 12px;
  max-height: 120px;
  line-height: 20px;
  outline: none;
}
.reply-bar, .attach-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  margin-bottom: 6px;
  padding: 8px 10px;
}
.reply-bar div, .attach-preview div { min-width: 0; flex: 1; }
.reply-bar b { color: var(--accent); font-size: 13px; display: block; }
.reply-bar span, .attach-preview span { color: var(--muted); font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-chip {
  display: block;
  margin: 2px 4px 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(11, 20, 26, 0.06);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  word-break: break-all;
}
body.dark .file-chip { background: rgba(255, 255, 255, 0.08); }
.reply-bar button, .attach-preview button {
  border: 0;
  background: transparent;
  color: var(--icon);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: none;
}
.attach-preview img { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; }
.record-bar { height: 48px; color: var(--text); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ea0038; animation: blink 1s infinite; }
.rec-hint { flex: 1; color: var(--muted); }
.send-round { color: var(--green) !important; }
.jump {
  position: absolute;
  right: 18px;
  bottom: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: var(--panel);
  color: var(--icon);
  box-shadow: 0 1px 3px rgba(11, 20, 26, 0.25);
  display: grid;
  place-items: center;
}

.empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--empty);
  border-bottom: 6px solid var(--badge);
  padding: 32px 24px 0;
  color: var(--muted);
}
.empty h1 { font-weight: 300; font-size: 32px; margin: 18px 0 10px; color: var(--text); }
.empty p { max-width: 440px; margin: 0 0 28px; font-size: 14px; line-height: 20px; }
.lockline { margin-top: auto; margin-bottom: 28px; display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }

.drawer {
  position: absolute;
  inset: 0;
  background: var(--panel);
  z-index: 6;
  display: flex;
  flex-direction: column;
}
.drawer h2 { font-size: 19px; font-weight: 500; margin: 0; }
.drawer-body { overflow: auto; flex: 1; background: var(--info-bg); }
.drawer-body.plain { background: var(--panel); }
.section-label { color: var(--accent); font-size: 14px; padding: 18px 30px 8px; font-weight: 500; }
.card { background: var(--panel); padding: 12px 20px; }
.card + .card { border-top: 1px solid var(--border); }
.hint { color: var(--muted); font-size: 13px; padding: 16px 20px 24px; line-height: 18px; }
.about-input {
  width: 100%;
  border: 0;
  border-bottom: 2px solid var(--green);
  background: transparent;
  padding: 8px 0;
  outline: none;
}
.check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted); display: grid; place-items: center; color: transparent; }
.person-row.on .check { background: var(--green); border-color: var(--green); color: #fff; }
.primary {
  margin: 16px;
  height: 42px;
  border: 0;
  border-radius: 24px;
  background: var(--green);
  color: #fff;
  font-weight: 600;
}
.status-ring { padding: 3px; border-radius: 50%; border: 2px solid var(--badge); }
.status-ring.seen { border-color: var(--border); }
.story {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: #111b21;
  color: #fff;
  display: flex;
  flex-direction: column;
}
.story header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.story .bars { position: absolute; top: 8px; left: 10px; right: 10px; display: flex; gap: 4px; }
.story .bars b { height: 3px; flex: 1; background: rgba(255,255,255,.35); border-radius: 2px; overflow: hidden; }
.story .bars b.on i { display: block; height: 100%; background: #fff; width: 100%; }
.story .bars b.now i { width: 0; animation: fill 5s linear forwards; }
@keyframes fill { to { width: 100%; } }
.story .content { flex: 1; display: grid; place-items: center; padding: 32px; text-align: center; font-size: 28px; line-height: 1.35; }
.story textarea {
  width: min(520px, 100%);
  min-height: 120px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 28px;
  text-align: center;
  resize: none;
  outline: none;
}
.story .nav { position: absolute; inset: 60px 0 0; display: flex; }
.story .nav button { flex: 1; background: transparent; border: 0; }

.info { width: min(420px, 38vw); background: var(--info-bg); border-left: 1px solid var(--border); overflow: auto; flex: none; }
.info .hero { background: var(--header); text-align: center; padding-bottom: 18px; }
.info .hero h2 { margin: 0; font-size: 22px; font-weight: 500; }
.info .hero p { margin: 4px 0 0; color: var(--muted); }
.info h3 { margin: 0; }
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px 0 0; }
.media-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; cursor: pointer; }
.danger { color: #ea0038; }

.lightbox, .call {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(11, 20, 26, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox img { max-width: 94vw; max-height: 92vh; }
.lightbox .x, .story .x, .call .x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
}
.call { flex-direction: column; color: #fff; }
.call video.remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.call video.pip { position: absolute; width: 132px; height: 176px; right: 16px; top: 16px; object-fit: cover; border-radius: 12px; background: #111; }
.call .call-card { position: relative; z-index: 1; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.call .call-card .avatar { width: 180px; height: 180px; }
.call h2 { margin: 12px 0 0; font-weight: 400; font-size: 32px; }
.call .status { color: rgba(255,255,255,.75); min-height: 22px; }
.call .actions { position: absolute; bottom: 48px; display: flex; gap: 28px; z-index: 2; }
.call .actions button {
  width: 58px; height: 58px; border-radius: 50%; border: 0; color: #fff; display: grid; place-items: center;
}
.call .ok { background: #25d366; }
.call .no { background: #ea0038; }
.call .no svg { transform: rotate(135deg); }
.call .ghost { background: rgba(255,255,255,.16); }
.pulse { animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 50% { transform: scale(1.04); } }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #323739;
  color: #fff;
  padding: 10px 16px;
  border-radius: 24px;
  z-index: 70;
  font-size: 14px;
  max-width: min(420px, 90vw);
}

.splash {
  position: fixed;
  inset: 0;
  background: #f0f2f5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  z-index: 80;
  color: #54656f;
}
body.dark .splash { background: #111b21; color: #8696a0; }
.splash img { width: 72px; height: 72px; }
.splash strong { color: #41525d; font-size: 18px; font-weight: 500; letter-spacing: 0.2px; }
.splash-bar { width: 240px; height: 3px; background: #e9edef; margin-top: 18px; overflow: hidden; }
.splash-bar span { display: block; height: 100%; width: 40%; background: #00a884; animation: load 1s ease-in-out infinite; }
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

.login-body { background: #d1d7db; overflow: auto; min-height: 100%; }
.login-banner { position: fixed; left: 0; right: 0; top: 0; height: 222px; background: #00a884; z-index: 0; }
.login-card {
  position: relative;
  z-index: 1;
  width: min(1100px, calc(100% - 32px));
  margin: 140px auto 40px;
  background: #fff;
  min-height: 420px;
  box-shadow: 0 6px 18px rgba(11, 20, 26, 0.15);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}
.login-form-wrap, .login-steps { padding: 48px 48px 36px; }
.login-logo { width: 48px; height: 48px; }
.login-form-wrap h1 { font-weight: 400; font-size: 28px; margin: 12px 0 6px; color: #41525d; }
.login-lead { margin: 0 0 22px; color: #667781; }
.login-form-wrap label { display: block; color: #008069; font-size: 14px; margin-bottom: 14px; }
.login-form-wrap input {
  display: block;
  width: 100%;
  margin-top: 6px;
  border: 0;
  border-bottom: 2px solid #00a884;
  padding: 8px 0;
  outline: none;
  color: #111b21;
  background: transparent;
}
.login-submit {
  margin-top: 8px;
  background: #00a884;
  color: #fff;
  border: 0;
  border-radius: 24px;
  height: 40px;
  padding: 0 24px;
  font-weight: 600;
}
.login-error { color: #ea0038; min-height: 20px; }
.login-steps { background: #f7f8f8; color: #41525d; }
.login-steps h2 { font-weight: 400; margin-top: 0; }
.login-steps li { margin: 0 0 14px; line-height: 1.4; }
.login-steps ol { padding-left: 18px; }

.nodes {
  display: flex;
  gap: 14px;
  padding: 8px 16px 4px;
}
.node {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.node i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c4c9cc;
}
.node.up i { background: #25d366; box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.22); }
.node.down i { background: #ea0038; }
.node.here { color: var(--text); font-weight: 600; }
.peer {
  display: block;
  padding: 10px 16px 14px;
  color: var(--muted);
  font-size: 12.5px;
  text-decoration: none;
  border-top: 1px solid var(--border);
}
.peer:hover { color: var(--accent); }
.model-list { display: flex; flex-direction: column; }
.model-list button.on { background: var(--active); }
.send.stop { color: #ea0038; }
.bubble.live { opacity: 0.95; }

@media (max-width: 760px) {
  body.narrow .sidebar { width: 100%; border-right: 0; }
  body.narrow:not(.in-chat) .stage { display: none; }
  body.narrow.in-chat .sidebar { display: none; }
  body.narrow.in-chat .back { display: grid; place-items: center; }
  .info { width: 100%; }
  .login-card { grid-template-columns: 1fr; margin-top: 28px; }
  .login-banner { height: 120px; }
  .login-form-wrap, .login-steps { padding: 28px 20px; }
  .msg, .msg.out { padding-left: 12px; padding-right: 12px; }
  .bubble { max-width: 86%; }
}

.sandbox {
  width: min(640px, 48vw);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #0b141a;
  border-left: 1px solid var(--border);
}
.sandbox-bar {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 14px;
  background: var(--header);
  color: var(--text);
  flex: none;
}
.sandbox-bar strong { flex: 1; font-size: 16px; }
.sandbox-bar button {
  border: 0;
  background: transparent;
  color: var(--icon);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.sandbox-bar .textbtn {
  width: auto;
  height: 30px;
  padding: 0 10px;
  border-radius: 14px;
  background: var(--chip);
  color: var(--text);
  font-size: 13px;
}
.sandbox iframe { flex: 1; width: 100%; border: 0; background: #111; min-height: 0; }
.skills { background: var(--panel); color: var(--text); }
.skills-body { flex: 1; overflow: auto; min-height: 0; }
.skills-head {
  padding: 14px 16px 4px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.skill { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.skill-top { display: flex; align-items: baseline; gap: 8px; }
.skill-top b { font-size: 15px; }
.skill-tag {
  margin-left: auto;
  flex: none;
  font-size: 12px;
  color: var(--muted);
  background: var(--chip);
  border-radius: 10px;
  padding: 2px 8px;
}
.skill-tag.on { color: var(--chip-on-text); background: var(--chip-on); }
.skill p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.skills-empty { margin: 0; padding: 24px 16px; color: var(--muted); }

@media (max-width: 760px) {
  .sandbox { position: fixed; inset: 0; width: auto; z-index: 50; }
}
