:root {
  --bg:         #04060a;
  --bg-elev:    rgba(15, 17, 23, 0.72);
  --bg-card:    rgba(21, 23, 30, 0.68);
  --bg-hover:   rgba(28, 31, 40, 0.78);
  --bg-input:   rgba(7, 9, 13, 0.74);
  --border:     rgba(255, 255, 255, 0.08);
  --border-hi:  rgba(255, 255, 255, 0.16);
  --text:       #f2f2f7;
  --text-sec:   #b0b3bd;
  --muted:      #7e828d;
  --accent:     #f2f2f7;
  --accent-ink: #08090c;
  --frost:      #8ab4f8;
  --green:      #32d74b;
  --red:        #ff453a;
  --yellow:     #ffd60a;
  --radius:     14px;
  --radius-sm:  9px;
  --ease:       cubic-bezier(0.22, 1, 0.36, 1);
  --font:       -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 400;
  letter-spacing: -0.008em;
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.hidden { display: none !important; }
.screen { position: relative; z-index: 2; min-height: 100vh; }

/* ── Midnight Atmosphere & Parallax Snow Canvas (Always On) ── */
.atmo-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 85% 60% at 50% -12%, rgba(30, 50, 82, 0.28), transparent 68%),
    radial-gradient(ellipse 65% 50% at 85% 110%, rgba(20, 34, 58, 0.22), transparent 70%),
    linear-gradient(180deg, #04060c 0%, #050810 55%, #020306 100%);
  overflow: hidden;
}

.atmo-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(95px);
  opacity: 0.42;
  will-change: transform;
}

.atmo-glow-a {
  width: 56vw;
  height: 46vh;
  top: -14vh;
  left: 14vw;
  background: radial-gradient(circle, rgba(138, 180, 248, 0.16), rgba(45, 78, 130, 0.05) 55%, transparent 72%);
  animation: atmo-drift-a 26s ease-in-out infinite alternate;
}

.atmo-glow-b {
  width: 48vw;
  height: 44vh;
  bottom: -16vh;
  right: 8vw;
  background: radial-gradient(circle, rgba(120, 155, 210, 0.12), rgba(22, 38, 66, 0.04) 55%, transparent 72%);
  animation: atmo-drift-b 32s ease-in-out infinite alternate;
}

@keyframes atmo-drift-a {
  0%   { transform: translate3d(-4%, -2%, 0) scale(1); }
  50%  { transform: translate3d(6%, 4%, 0) scale(1.06); }
  100% { transform: translate3d(-2%, 7%, 0) scale(0.98); }
}

@keyframes atmo-drift-b {
  0%   { transform: translate3d(4%, 3%, 0) scale(1); }
  50%  { transform: translate3d(-6%, -4%, 0) scale(1.08); }
  100% { transform: translate3d(2%, -2%, 0) scale(1.02); }
}

#snow-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* ── Login ── */
#screen-login {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 376px;
  background: var(--bg-card);
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 34px 28px 30px;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  animation: modal-pop 0.42s var(--ease) both;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(5px); }
}
.login-card.shake { animation: shake 0.36s cubic-bezier(0.36, 0.07, 0.19, 0.97); }

.login-logo {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 26px;
}
.brand-mark-lg {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.logo-text {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
}

.warn-banner {
  background: rgba(255, 214, 10, 0.08);
  border: 1px solid rgba(255, 214, 10, 0.24);
  color: #ffd60a;
  font-size: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.lockout-wrap { margin-top: 14px; }
.lockout-label { font-size: 12px; color: var(--red); margin-bottom: 6px; font-weight: 500; }
.lockout-bar { height: 4px; background: var(--bg-input); border-radius: 99px; overflow: hidden; }
.lockout-fill { height: 100%; background: var(--red); width: 100%; transition: width 1s linear; }

/* ── Forms ── */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.opt { font-weight: 400; opacity: 0.7; }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap input { padding-right: 66px; }

input[type="text"],
input[type="password"],
input[type="search"],
input[type="number"],
select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  letter-spacing: -0.005em;
  outline: none;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
}
input::placeholder { color: rgba(142, 142, 147, 0.55); }
input:focus, select:focus {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(12, 15, 22, 0.9);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.eye-btn {
  position: absolute;
  right: 7px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-sec);
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  transition: color 0.15s, background 0.15s;
}
.eye-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.12); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}
.chk-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-sec);
  cursor: pointer;
  user-select: none;
}
.chk-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--text);
  cursor: pointer;
}

/* ── Unified Apple Monochrome & Frosted Button System ── */
button, .btn-sm-link {
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: background 0.16s var(--ease), color 0.16s var(--ease), border-color 0.16s var(--ease), transform 0.14s var(--ease), opacity 0.16s var(--ease);
}
button:active:not(:disabled), .btn-sm-link:active { transform: scale(0.97); }
button:disabled { opacity: 0.42; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) { background: #ffffff; }
.btn-full { width: 100%; }

.btn-sm-link {
  text-decoration: none;
  padding: 7px 14px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-sec);
  padding: 7px 13px;
  font-size: 13px;
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.11);
  border-color: var(--border-hi);
  color: var(--text);
}
.btn-full-left { width: 100%; text-align: left; }

.btn-danger {
  background: rgba(255, 69, 58, 0.16);
  color: #ff7a73;
  border: 1px solid rgba(255, 69, 58, 0.34);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
}
.btn-danger:hover:not(:disabled) { background: rgba(255, 69, 58, 0.28); color: #ffffff; }

.icon-btn {
  padding: 7px 11px;
  font-size: 14px;
  line-height: 1;
}

/* Uniform card buttons */
.btn-sm {
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 7px;
  border: 1px solid var(--border);
}
.btn-neutral {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-sec);
}
.btn-neutral:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.11);
  border-color: var(--border-hi);
  color: var(--text);
}
.btn-active-soft {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.24);
  color: var(--text);
}
.btn-active-soft:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}
.btn-del {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}
.btn-del:hover:not(:disabled) {
  background: rgba(255, 69, 58, 0.12);
  color: #ff7a73;
  border-color: rgba(255, 69, 58, 0.26);
}

/* ── Messages ── */
.msg {
  margin-top: 14px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  animation: modal-pop 0.25s var(--ease) both;
}
.msg.error { background: rgba(255, 69, 58, 0.1); border: 1px solid rgba(255, 69, 58, 0.26); color: #ff827b; }
.msg.ok    { background: rgba(50, 215, 75, 0.1); border: 1px solid rgba(50, 215, 75, 0.26); color: #6be57e; }

/* ── Layout ── */
#screen-dash { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-elev);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--text);
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
  transition: opacity 0.16s;
}
.sidebar-logo:hover { opacity: 0.9; }
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 14.5px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; }
.brand-sub  { font-size: 11px; color: var(--muted); }

nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.nav-btn {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.16s var(--ease), color 0.16s var(--ease), transform 0.16s var(--ease);
}
.nav-btn:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); transform: translateX(2px); }
.nav-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.sidebar-stats {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.sys-metric { display: flex; flex-direction: column; gap: 4px; }
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--muted);
}
.stat-row strong { color: var(--text-sec); font-weight: 600; font-variant-numeric: tabular-nums; }
.text-green { color: var(--green) !important; }

.sys-bar {
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.sys-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: rgba(242, 242, 247, 0.72);
  transition: width 0.45s var(--ease);
}
.sys-fill.warn { background: var(--yellow); }
.sys-fill.crit { background: var(--red); }

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.online-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--muted);
  padding: 0 4px;
}
.dot-green {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(50, 215, 75, 0.55);
  animation: pulse-live 2.8s ease-out infinite;
}

/* ── Main Area ── */
.main-area {
  flex: 1;
  min-width: 0;
  padding: 30px 34px 72px;
  max-width: 1200px;
}

.tab.active {
  animation: tab-enter 0.36s var(--ease) both;
}

@keyframes tab-enter {
  from { opacity: 0; transform: translate3d(0, 8px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

.tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}
.tab-header h1 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.tab-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.header-actions { display: flex; align-items: center; gap: 8px; }

/* ── Toolbar & Segmented Controls ── */
.toolbar-panel {
  background: var(--bg-card);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-bottom: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.toolbar-search {
  flex: 1;
  min-width: 220px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  color: var(--text);
  font-size: 13px;
}
.filter-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
.filter-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 99px;
}
.filter-pill:hover { color: var(--text); background: rgba(255, 255, 255, 0.09); }
.filter-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.pill-cnt {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
}
.filter-pill.active .pill-cnt {
  background: rgba(0, 0, 0, 0.14);
  color: var(--accent-ink);
}

.toolbar-bulk {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.bulk-seg {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}
.seg-btn {
  background: transparent;
  color: var(--text-sec);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
}
.seg-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
}

/* ── Bot Grid & Cards ── */
.bot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

@keyframes card-enter {
  from { opacity: 0; transform: translate3d(0, 12px, 0) scale(0.985); }
  to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.bot-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 0.22s var(--ease), background 0.22s var(--ease), transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.bot-card.is-new { animation: card-enter 0.42s var(--ease) both; }
.bot-card.stagger-0 { animation-delay: 0ms; }
.bot-card.stagger-1 { animation-delay: 40ms; }
.bot-card.stagger-2 { animation-delay: 80ms; }
.bot-card.stagger-3 { animation-delay: 120ms; }
.bot-card.stagger-4 { animation-delay: 160ms; }
.bot-card.stagger-5 { animation-delay: 200ms; }
.bot-card.stagger-6 { animation-delay: 240ms; }
.bot-card.stagger-7 { animation-delay: 280ms; }
.bot-card.stagger-8 { animation-delay: 320ms; }

.bot-card:hover {
  border-color: var(--border-hi);
  background: var(--bg-hover);
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.bot-header { display: flex; align-items: center; gap: 12px; }
.bot-meta { flex: 1; min-width: 0; }
.bot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-input);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.25s var(--ease);
}
.bot-card:hover .bot-avatar { transform: scale(1.04); }

.bot-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bot-tag {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bot-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.bot-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-sec);
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

@keyframes pulse-live {
  0%   { box-shadow: 0 0 0 0 rgba(50, 215, 75, 0.55); }
  70%  { box-shadow: 0 0 0 6px rgba(50, 215, 75, 0); }
  100% { box-shadow: 0 0 0 0 rgba(50, 215, 75, 0); }
}

.status-connected { color: #e9faec; border-color: rgba(50, 215, 75, 0.28); background: rgba(50, 215, 75, 0.09); }
.status-connected .dot { background: var(--green); animation: pulse-live 2.4s ease-out infinite; }
.status-connecting { color: #fde68a; border-color: rgba(255, 214, 10, 0.25); background: rgba(255, 214, 10, 0.07); }
.status-connecting .dot { background: var(--yellow); }
.status-ready { color: var(--text); border-color: rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.06); }
.status-stopped { color: var(--muted); }
.status-error { color: #ff8e88; border-color: rgba(255, 69, 58, 0.28); background: rgba(255, 69, 58, 0.09); }
.status-error .dot { background: var(--red); }

/* Harmonious monochrome toggle pills */
.mini-pill {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}
.mini-pill:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.11);
  border-color: var(--border-hi);
  color: var(--text);
}
.pill-on   { color: var(--text); background: rgba(255, 255, 255, 0.11); border-color: rgba(255, 255, 255, 0.2); }
.pill-off  { color: var(--muted); background: rgba(255, 255, 255, 0.025); }
.pill-live { color: #ffd4d1; background: rgba(255, 69, 58, 0.16); border-color: rgba(255, 69, 58, 0.34); }
.pill-wait { color: #fde68a; background: rgba(255, 214, 10, 0.09); border-color: rgba(255, 214, 10, 0.24); }
.pill-idle { color: var(--muted); }

.bot-info {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
}

.empty-state {
  grid-column: 1 / -1;
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  border: 1px dashed var(--border-hi);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ── Add Bot Form Card ── */
.form-card {
  max-width: 560px;
  background: var(--bg-card);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ── Modals ── */
@keyframes overlay-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modal-pop {
  from { opacity: 0; transform: translate3d(0, 10px, 0) scale(0.96); }
  to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  animation: overlay-fade 0.2s ease both;
}
.modal {
  width: 100%;
  max-width: 410px;
  background: rgba(22, 24, 31, 0.88);
  backdrop-filter: blur(26px) saturate(165%);
  -webkit-backdrop-filter: blur(26px) saturate(165%);
  border: 1px solid var(--border-hi);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.78), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: modal-pop 0.26s var(--ease) both;
}
.modal h3 { font-size: 16.5px; font-weight: 600; margin-bottom: 16px; letter-spacing: -0.02em; }
.modal-desc { font-size: 13px; color: var(--muted); margin-bottom: 20px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ── Toasts ── */
.toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
  pointer-events: none;
}
.toast-item {
  background: rgba(24, 26, 33, 0.9);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--border-hi);
  border-radius: 10px;
  padding: 10px 15px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translate3d(0, 8px, 0) scale(0.97);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}
.toast-item.show { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
.toast-ok    { border-color: rgba(50, 215, 75, 0.35); color: #9cf2aa; }
.toast-error { border-color: rgba(255, 69, 58, 0.4); color: #ff8e88; }

/* ── Reduced Motion Support ── */
@media (prefers-reduced-motion: reduce) {
  .atmo-glow, .dot-green, .status-connected .dot, .bot-card.is-new, .tab.active, .modal {
    animation: none !important;
  }
}

/* ── Responsive ── */
@media (max-width: 780px) {
  #screen-dash { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
  }
  .sidebar-logo { padding: 0 0 10px; margin-bottom: 10px; }
  nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-stats { display: none; }
  .sidebar-footer { flex-direction: row; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; }
  .btn-full-left { width: auto; }
  .main-area { padding: 20px 16px 64px; }
  .field-row { grid-template-columns: 1fr; }
}
