:root {
  --color-ink: #17191c;
  --color-pure-white: #ffffff;
  --color-fog: #f7f7f8;
  --color-ash: #4c4c4c;
  --color-graphite: #777b86;
  --color-dove: #a3a6af;
  --color-rust: #5d2a1a;
  --color-apricot-wash: #fbe1d1;
  --color-gold-wash: #fff4c7;
  --color-sky-wash: #d3e3fc;
  --color-mint-wash: #dff3e6;
  --color-lilac-wash: #eadffc;
  --color-rose-wash: #ffe6e6;
  --shadow-subtle: rgba(4, 23, 43, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 20px 25px -5px, rgba(0, 0, 0, 0.1) 0px 8px 10px -6px;
  --shadow-soft: rgba(4, 23, 43, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.08) 0px 12px 24px -12px;
  --font-signifier: Georgia, 'Times New Roman', serif;
  --font-sohne: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; }
html, body, #app { width: 100%; height: 100%; min-height: 0; overflow: hidden; }
body {
  margin: 0;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  color: var(--color-ink);
  background:
    radial-gradient(circle at 50% 8%, rgba(251, 225, 209, 0.68), rgba(251, 225, 209, 0.0) 34rem),
    linear-gradient(180deg, var(--color-pure-white) 0%, var(--color-fog) 100%);
  font-family: var(--font-sohne);
  letter-spacing: -0.009em;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
svg { width: 18px; height: 18px; display: block; }
.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.brand { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 500; }
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  background: var(--color-ink);
  color: #fff;
  box-shadow: var(--shadow-subtle);
  font-weight: 500;
}
.topbar-note { color: var(--color-graphite); font-size: 14px; }
.login-grid {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 56px 0 80px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.75fr);
  gap: 32px;
  align-items: center;
  min-height: calc(100vh - 72px);
}
.login-grid.standalone { min-height: 100vh; }
.login-grid.clean-login {
  min-height: 100vh;
  padding: 28px 0 56px;
  grid-template-columns: minmax(320px, 520px);
  justify-content: center;
  align-content: center;
  gap: 20px;
}
.hero-copy { padding: 24px; }
.login-grid.clean-login .hero-copy { padding: 0; text-align: center; }
.login-grid.clean-login h1 { max-width: none; font-size: clamp(42px, 7vw, 76px); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-rust);
  background: rgba(251, 225, 209, 0.66);
  border-radius: 9999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 450;
  margin-bottom: 24px;
}
h1 {
  margin: 0;
  max-width: 720px;
  font-family: var(--font-signifier);
  font-size: clamp(48px, 8vw, 90px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-weight: 400;
}
.lead {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--color-ash);
  font-size: 18px;
  line-height: 1.45;
}
.card {
  background: var(--color-pure-white);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-subtle);
}
.login-card { display: grid; gap: 20px; }
.card-kicker { color: var(--color-graphite); font-size: 14px; line-height: 1.45; margin: 0 0 8px; }
.card-title { margin: 0; font-size: 26px; line-height: 1.18; letter-spacing: -0.23px; font-weight: 500; }
.telegram-box {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: var(--color-fog);
  padding: 20px;
}
.message {
  display: none;
  border-radius: 16px;
  padding: 14px 16px;
  background: #fff3ee;
  color: var(--color-rust);
  font-size: 14px;
  line-height: 1.45;
}
.muted { color: var(--color-graphite); font-size: 14px; line-height: 1.5; margin: 0; }
.button {
  appearance: none;
  border: 0;
  border-radius: 9999px;
  background: var(--color-ink);
  color: #fff;
  padding: 10px 20px;
  font: 450 15px/1.25 var(--font-sohne);
  cursor: pointer;
  letter-spacing: -0.009em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.button.ghost { background: var(--color-fog); color: var(--color-ink); }
.button:disabled { opacity: 0.45; cursor: default; }
.button.active { background: var(--color-apricot-wash); color: var(--color-rust); }
.admin-app {
  width: min(1640px, calc(100vw - 12px));
  height: calc(100dvh - 20px);
  margin: 0 auto;
  padding: 10px 0 18px;
  min-height: 0;
  display: grid;
  grid-template-columns: 300px minmax(0, 1.28fr) 300px;
  grid-template-rows: minmax(0, 1fr) 0px;
  grid-template-areas:
    "sidebar main details"
    "sidebar members details";
  column-gap: 12px;
  row-gap: 0;
  overflow: hidden;
  transition: grid-template-columns 280ms ease, grid-template-rows 280ms ease, row-gap 280ms ease;
}
.admin-app.participants-open { grid-template-rows: minmax(0, 1fr) minmax(220px, 34%); row-gap: 12px; }
.admin-app.settings-open { grid-template-rows: minmax(0, 1fr) minmax(300px, 44%); row-gap: 12px; }
.sidebar, .main-panel, .members-panel, .settings-panel, .details-panel {
  min-height: 0;
  min-width: 0;
  max-height: 100%;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(12px);
  border-radius: 26px;
  box-shadow: var(--shadow-subtle);
  overflow: hidden;
}
.sidebar { grid-area: sidebar; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.main-panel { grid-area: main; }
.members-panel { grid-area: members; }
.settings-panel { grid-area: members; }
.details-panel { grid-area: details; }
.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid rgba(23, 25, 28, 0.06);
}
.side-title { font-size: 18px; font-weight: 540; }
.search-wrap { padding: 14px 14px 8px; }
.search-box {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: var(--color-fog);
  border-radius: 9999px;
  color: var(--color-graphite);
}
.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-ink);
  min-width: 0;
}
.chat-list { padding: 8px; overflow-y: auto; overflow-x: hidden; min-height: 0; }
.chat-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 22px;
  gap: 11px;
  align-items: center;
  text-align: left;
  padding: 10px;
  border-radius: 18px;
  cursor: pointer;
  min-width: 0;
  max-width: 100%;
  transition: background 135ms ease, opacity 135ms ease;
}
.chat-item:hover { background: rgba(247, 247, 248, 0.9); }
.chat-item.active { background: var(--color-apricot-wash); animation: activeChatFade 135ms ease both; }
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 9999px;
  object-fit: cover;
  background: var(--color-ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 520;
  flex: 0 0 auto;
}
.chat-text { min-width: 0; display: grid; gap: 3px; }
.chat-title-wrap {
  min-width: 0;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 520;
  line-height: 1.2;
}
.chat-title-wrap.is-faded::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 34px;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.96));
}
.chat-item.active .chat-title-wrap.is-faded::after { background: linear-gradient(90deg, rgba(251,225,209,0), var(--color-apricot-wash)); }
.chat-title { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chat-sub { color: var(--color-graphite); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-accent { color: var(--color-rust); }
.profile-bar {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto auto;
  gap: 11px;
  align-items: center;
  padding: 14px;
  border-top: 1px solid rgba(23, 25, 28, 0.06);
  background: rgba(247, 247, 248, 0.72);
}
.profile-name, .profile-id { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-name { font-size: 14px; font-weight: 540; }
.profile-id { color: var(--color-graphite); font-size: 12px; margin-top: 3px; }
.icon-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  background: var(--color-pure-white);
  color: var(--color-ink);
  box-shadow: rgba(4, 23, 43, 0.05) 0 0 0 1px;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}
.icon-button:hover { box-shadow: var(--shadow-soft); }
.main-panel { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.main-head {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(23, 25, 28, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
  overflow: hidden;
  flex: 0 0 auto;
}
.main-title-side { min-width: 0; flex: 1 1 auto; }
.main-title-line {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.participants-button {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 14px;
  box-shadow: rgba(4, 23, 43, 0.05) 0 0 0 1px;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}
.participants-button:not(:disabled):hover { box-shadow: var(--shadow-soft); }
.main-title-wrap {
  min-width: 0;
  flex: 0 1 auto;
  max-width: min(100%, 1520px);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
.main-title-wrap.is-faded::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 42px;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.94));
}
.main-title {
  margin: 0;
  font-family: var(--font-signifier);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.18;
  letter-spacing: -0.025em;
  font-weight: 400;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.main-note {
  flex: 0 0 auto;
  color: var(--color-graphite);
  font-size: 13px;
  white-space: nowrap;
}
.chat-stack {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}
.history {
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-anchor: none;
  scroll-behavior: smooth;
  padding: 18px;
  background:
    radial-gradient(circle at top left, rgba(211, 227, 252, 0.28), transparent 24rem),
    rgba(247, 247, 248, 0.72);
}
.members-panel, .settings-panel {
  padding: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  pointer-events: none;
  box-shadow: none;
  transition: opacity 220ms ease, transform 280ms ease, box-shadow 220ms ease, padding 220ms ease;
}
.admin-app.participants-open .members-panel, .admin-app.settings-open .settings-panel {
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  box-shadow: var(--shadow-subtle);
}
.members-title {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  gap: 4px;
  padding: 16px 18px 12px;
  background: var(--color-pure-white);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(23, 25, 28, 0.06);
}
.members-title strong { font-size: 15px; font-weight: 540; }
.members-title span { color: var(--color-graphite); font-size: 12px; }
.members-loading { min-height: 100%; display: grid; place-items: center; }
.participants-list { display: grid; gap: 8px; padding: 12px; }
.participant-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px;
  border-radius: 18px;
  background: rgba(247, 247, 248, 0.8);
  animation: fadeInUp 180ms ease both;
}
.participant-row.admin { background: var(--color-rose-wash); }
.participant-row.creator { background: var(--color-gold-wash); }
.participant-avatar {
  width: 42px;
  height: 42px;
  border-radius: 9999px;
  object-fit: cover;
  background: var(--color-ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 520;
}
.participant-main { min-width: 0; display: grid; gap: 3px; }
.participant-name, .participant-username { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.participant-name { font-size: 14px; font-weight: 540; display: flex; align-items: center; gap: 6px; }
.interacted-badge {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  color: var(--color-rust);
  line-height: 1;
  cursor: help;
}
.interacted-badge svg { width: 16px; height: 16px; }
.participant-username { color: var(--color-graphite); font-size: 12px; }
.participant-id {
  color: var(--color-ash);
  background: var(--color-pure-white);
  border-radius: 9999px;
  padding: 7px 10px;
  font-size: 12px;
  white-space: nowrap;
}
.history.is-empty { display: grid; place-items: center; }
.history.is-empty .empty { min-height: 0; width: min(100%, 520px); margin: 0 auto; }
.history.is-loading { opacity: 0.8; transition: opacity 90ms ease; }
.empty {
  min-height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--color-graphite);
  padding: 24px;
}
.thread { display: grid; gap: 20px; }
.message-row { display: flex; gap: 10px; align-items: flex-end; min-width: 0; max-width: 100%; }
.message-row.is-new { animation: messageIn 260ms ease both; }
.message-row.user { justify-content: flex-start; }
.message-row.bot { justify-content: flex-end; }
.message-row.bot .bubble-wrap { align-items: flex-end; }
.message-avatar {
  width: 42px;
  height: 42px;
  border-radius: 9999px;
  object-fit: cover;
  background: var(--color-ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 520;
  flex: 0 0 auto;
}
.bubble-wrap { display: flex; flex-direction: column; gap: 6px; max-width: min(76%, 720px); min-width: 0; overflow: hidden; }
.bubble-meta { color: var(--color-graphite); font-size: 12px; display: flex; gap: 8px; padding: 0 4px; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bubble {
  border-radius: 22px;
  padding: 14px 16px;
  box-shadow: var(--shadow-soft);
  line-height: 1.48;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.bubble:hover { transform: translateY(-1px); }
.message-row.user .bubble { background: var(--color-pure-white); border-bottom-left-radius: 8px; }
.message-row.bot .bubble { background: var(--color-sky-wash); border-bottom-right-radius: 8px; }
.photo-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.photo-grid img { max-width: min(220px, 100%); max-height: 220px; object-fit: cover; border-radius: 16px; box-shadow: var(--shadow-soft); }
.details-panel { padding: 14px; overflow-y: auto; overflow-x: hidden; }
.details-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 540;
  margin-bottom: 16px;
}
.tiles { display: grid; gap: 12px; }
.tile {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 16px;
  min-height: 112px;
  background: var(--color-pure-white);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  transition: box-shadow 180ms ease, opacity 180ms ease;
}
.tile:hover { box-shadow: var(--shadow-subtle); }
.tile.warm { background: var(--color-apricot-wash); }
.tile.cool { background: var(--color-sky-wash); }
.tile.mint { background: var(--color-mint-wash); }
.tile.lilac { background: var(--color-lilac-wash); }
.tile.rose { background: var(--color-rose-wash); }
.tile-head { display: flex; align-items: center; gap: 9px; color: var(--color-graphite); font-size: 13px; }
.tile-value { font-size: 22px; line-height: 1.15; font-weight: 520; overflow-wrap: anywhere; min-width: 0; max-width: 100%; }
.tile-desc { color: var(--color-ash); font-size: 12px; line-height: 1.42; }
.settings-content { display: grid; gap: 14px; padding: 12px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.settings-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  border-radius: 22px;
  padding: 14px;
  background: rgba(255,255,255,0.76);
  box-shadow: var(--shadow-soft);
}
.settings-card h3 { margin: 0 0 2px; display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 560; }
.settings-field { display: grid; gap: 7px; min-width: 0; color: var(--color-graphite); font-size: 12px; }
.settings-field > span:first-child { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.settings-field strong { color: var(--color-ink); font-weight: 540; }
.settings-field b { color: var(--color-rust); font-weight: 560; }
.settings-field input:not([type="range"]), .settings-field select, #prompt-editor {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--color-ink);
  font: inherit;
}
.settings-field input:not([type="range"]), #prompt-editor {
  border-radius: 16px;
  background: var(--color-fog);
  padding: 11px 12px;
  box-shadow: rgba(4, 23, 43, 0.05) 0 0 0 1px inset;
  transition: box-shadow 160ms ease, background 160ms ease, transform 160ms ease, opacity 160ms ease;
}
.settings-field input:not([type="range"]):focus, #prompt-editor:focus {
  background: rgba(255,255,255,0.88);
  box-shadow: rgba(4, 23, 43, 0.10) 0 0 0 1px inset, rgba(226, 116, 61, 0.18) 0 0 0 4px;
}
.select-wrap {
  position: relative;
  display: block;
  width: 100%;
  min-height: 42px;
}
.select-wrap select {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  min-height: 42px;
}
.custom-select { position: relative; width: 100%; }
.custom-select-button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 16px;
  background: var(--color-fog);
  color: var(--color-ink);
  box-shadow: rgba(4, 23, 43, 0.05) 0 0 0 1px inset;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  transition: box-shadow 160ms ease, background 160ms ease, transform 160ms ease;
}
.custom-select-button span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.custom-select-button i {
  width: 8px;
  height: 8px;
  border-right: 1.8px solid var(--color-graphite);
  border-bottom: 1.8px solid var(--color-graphite);
  transform: translateY(-2px) rotate(45deg);
  justify-self: center;
  opacity: 0.78;
  transition: transform 160ms ease;
}
.custom-select-button:hover { background: rgba(255,255,255,0.86); box-shadow: rgba(4, 23, 43, 0.08) 0 0 0 1px inset, rgba(4, 23, 43, 0.04) 0 8px 18px; }
.custom-select.is-open .custom-select-button { background: rgba(255,255,255,0.9); box-shadow: rgba(4, 23, 43, 0.10) 0 0 0 1px inset, rgba(226, 116, 61, 0.18) 0 0 0 4px; }
.custom-select.is-open .custom-select-button i { transform: translateY(2px) rotate(225deg); }
.custom-select-menu {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: min(280px, 42vh);
  overflow-y: auto;
  padding: 6px;
  border-radius: 18px;
  background: rgba(255,255,255,0.98);
  box-shadow: var(--shadow-subtle);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px) scale(0.985);
  transform-origin: top;
  transition: opacity 150ms ease, transform 150ms ease;
}
.custom-select.is-open .custom-select-menu { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
.custom-select-option {
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--color-ink);
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 120ms ease, color 120ms ease;
}
.custom-select-option:hover { background: var(--color-fog); }
.custom-select-option.is-selected { background: var(--color-apricot-wash); color: var(--color-rust); }
.custom-select-option:disabled { opacity: 0.45; cursor: default; }
.number-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.model-check-card { display: grid; gap: 10px; padding: 12px; border-radius: 18px; background: rgba(255,255,255,0.52); box-shadow: rgba(15, 23, 42, 0.05) 0 0 0 1px inset; }
.model-check-head { display: grid; gap: 4px; }
.model-check-head span { color: var(--color-graphite); font-size: 12px; }
.model-check-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.model-check-status, .model-check-result { display: grid; gap: 6px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,0.72); color: var(--color-ink); }
.model-check-status.is-running { box-shadow: rgba(226, 116, 61, 0.18) 0 0 0 1px inset; }
.model-check-status.is-error { box-shadow: rgba(182, 52, 52, 0.18) 0 0 0 1px inset; }
.model-check-result code, .model-check-status code { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.number-field input[type="number"] { min-height: 38px; padding: 9px 10px; border-radius: 14px; }
.number-field input[type="number"]::-webkit-outer-spin-button,
.number-field input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
  opacity: 0;
  transition: opacity 160ms ease;
}
.number-field:hover input[type="number"]::-webkit-outer-spin-button,
.number-field:hover input[type="number"]::-webkit-inner-spin-button,
.number-field input[type="number"]:focus::-webkit-outer-spin-button,
.number-field input[type="number"]:focus::-webkit-inner-spin-button { opacity: 1; }
.settings-switch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 18px;
  background: var(--color-fog);
}
.settings-switch span { display: grid; gap: 3px; min-width: 0; }
.settings-switch strong { font-size: 13px; font-weight: 540; }
.settings-switch em { color: var(--color-graphite); font-size: 12px; font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settings-switch input { display: none; }
.settings-switch i {
  width: 48px;
  height: 28px;
  border-radius: 9999px;
  background: #d7d9df;
  position: relative;
  transition: background 180ms ease;
}
.settings-switch i::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  left: 2px;
  top: 2px;
  border-radius: 9999px;
  background: #fff;
  box-shadow: rgba(0,0,0,0.16) 0 2px 6px;
  transition: transform 180ms ease;
}
.settings-switch input:checked + i { background: var(--color-ink); }
.settings-switch input:checked + i::after { transform: translateX(20px); }
.range-wrap {
  display: block;
  padding: 11px 12px;
  border-radius: 18px;
  background: var(--color-fog);
  box-shadow: rgba(4, 23, 43, 0.05) 0 0 0 1px inset;
}
.slider-field input[type="range"] {
  --value-percent: 0%;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 24px;
  background: transparent;
  cursor: pointer;
}
.slider-field input[type="range"]::-webkit-slider-runnable-track {
  height: 8.5px;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--color-ink) 0 var(--value-percent), #d7d9df var(--value-percent) 100%);
  box-shadow: rgba(4, 23, 43, 0.05) 0 1px 2px inset;
}
.slider-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -7.75px;
  border: 3px solid #fff;
  border-radius: 9999px;
  background: var(--color-ink);
  box-shadow: rgba(0,0,0,0.18) 0 4px 10px;
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.slider-field input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.08); box-shadow: rgba(0,0,0,0.22) 0 6px 16px; }
.slider-field input[type="range"]::-moz-range-track {
  height: 8.5px;
  border-radius: 9999px;
  background: #d7d9df;
}
.slider-field input[type="range"]::-moz-range-progress {
  height: 8.5px;
  border-radius: 9999px;
  background: var(--color-ink);
}
.slider-field input[type="range"]::-moz-range-thumb {
  width: 19px;
  height: 19px;
  border: 3px solid #fff;
  border-radius: 9999px;
  background: var(--color-ink);
  box-shadow: rgba(0,0,0,0.18) 0 4px 10px;
}
.save-settings { grid-column: 1 / -1; justify-content: center; }
.save-button {
  position: relative;
  overflow: hidden;
  width: 122px;
  min-width: 122px;
  justify-content: center;
  transition: width 220ms ease, min-width 220ms ease, transform 120ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease, opacity 180ms ease;
}
.save-button.is-saving { width: 136px; min-width: 136px; pointer-events: none; opacity: 0.78; }
.save-button.is-saved { width: 128px; min-width: 128px; background: var(--color-mint-wash); color: var(--color-ink); animation: savePop 320ms ease both; }
.save-button.is-error { width: 98px; min-width: 98px; background: var(--color-rose-wash); color: var(--color-ink); }
.save-settings:active, .save-prompt:active { transform: scale(0.985); }
.button-label { display: inline-block; transition: opacity 140ms ease, transform 140ms ease; }
.button-label.is-changing { opacity: 0; transform: translateY(3px); }
.prompt-card { grid-column: 1 / -1; }
#prompt-editor { min-height: 260px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.45; }
#prompt-editor.is-switching { opacity: 0.42; transform: translateY(3px); }
.save-settings.save-button,
.save-settings.save-button.is-saving,
.save-settings.save-button.is-saved,
.save-settings.save-button.is-error,
.save-prompt.save-button,
.save-prompt.save-button.is-saving,
.save-prompt.save-button.is-saved,
.save-prompt.save-button.is-error {
  width: 100%;
  min-width: 0;
}
.prompt-actions { display: grid; gap: 12px; }
.empty.slim { min-height: 120px; }
.icon-button.active { background: var(--color-apricot-wash); color: var(--color-rust); }
@media (max-width: 1120px) {
  .admin-app {
    grid-template-columns: 300px minmax(0, 1fr);
    grid-template-areas:
      "sidebar main"
      "sidebar members";
  }
  .admin-app.participants-open { grid-template-rows: minmax(0, 1fr) minmax(210px, 36%); }
  .admin-app.settings-open { grid-template-rows: minmax(0, 1fr) minmax(280px, 47%); }
  .details-panel { display: none; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  html, body, #app { height: 100%; overflow: hidden; }
  body { height: 100dvh; overflow: hidden; }
  .topbar-note { display: none; }
  .login-grid { grid-template-columns: 1fr; padding-top: 16px; }
  .login-grid.clean-login { width: calc(100vw - 20px); min-height: 100dvh; padding: 16px 0 24px; }
  .hero-copy { padding: 0; }
  .admin-app { width: calc(100vw - 10px); height: calc(100dvh - 10px); grid-template-columns: 1fr; grid-template-rows: minmax(0, 30%) minmax(0, 1fr) 0px; grid-template-areas: "sidebar" "main" "members"; gap: 8px; padding: 5px 0; overflow: hidden; }
  .admin-app.participants-open { grid-template-columns: 1fr; grid-template-rows: minmax(0, 25%) minmax(0, 1fr) minmax(0, 38%); }
  .admin-app.settings-open { grid-template-columns: 1fr; grid-template-rows: minmax(0, 20%) minmax(0, 1fr) minmax(0, 50%); }
  .sidebar, .main-panel, .members-panel, .settings-panel { border-radius: 22px; min-height: 0; overflow: hidden; }
  .search-wrap { padding: 10px 10px 6px; }
  .profile-bar { padding: 10px; }
  .main-head { padding: 10px 12px; align-items: center; }
  .participants-button { height: 36px; padding: 0 10px; font-size: 13px; }
  .participants-button svg { width: 16px; height: 16px; }
  .history { padding: 12px; }
  .members-panel, .settings-panel { padding: 0; transform: translateY(12px) scale(0.985); }
  .admin-app.participants-open .members-panel, .admin-app.settings-open .settings-panel { padding: 0; transform: translateY(0) scale(1); }
  .participant-row { grid-template-columns: 38px minmax(0, 1fr); }
  .participant-id { grid-column: 2; justify-self: start; padding: 4px 8px; }
  .participant-avatar { width: 38px; height: 38px; }
  .message-avatar { width: 36px; height: 36px; }
  .main-title { font-size: 20px; }
  .bubble-wrap { max-width: 88%; }
}


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

@keyframes messageIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes activeChatFade {
  from { background: rgba(251, 225, 209, 0.18); }
  to { background: var(--color-apricot-wash); }
}

@keyframes savePop {
  0% { transform: scale(0.985); }
  60% { transform: scale(1.018); }
  100% { transform: scale(1); }
}

@keyframes softFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

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