:root {
  --navy: #0b1f3b;
  --navy-2: #122a4d;
  --navy-3: #1a3a66;
  --ink: #14233c;
  --muted: #5d6e88;
  --line: #d7e3f4;
  --paper: #f4f7fc;
  --card: #ffffff;
  --blue: #2f6fed;
  --blue-2: #1d4ed8;
  --ice: #e7f0fe;
  --ok: #1b7f56;
  --ok-bg: #e7f6ee;
  --warn: #9a6b12;
  --warn-bg: #f8efd8;
  --bad: #b42338;
  --bad-bg: #fde8eb;
  --shadow: 0 10px 30px rgba(11, 31, 59, 0.08);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI",
    "Inter", "Manrope", system-ui, sans-serif;
  --stats-line: #3b82f6;
  --text: var(--ink);
  --danger: #e11d48;
  --danger-2: #9f1239;
  --success: #12a06a;
  --ring: rgba(47, 111, 237, 0.4);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 0.16s var(--ease);
  --t-med: 0.26s var(--ease);
  --grad: linear-gradient(
    calc(125deg + var(--spin)),
    #163a66,
    #2f6fed 42%,
    #5b93ff 58%,
    #1d4ed8
  );
}

* { box-sizing: border-box; }
* { scrollbar-width: thin; scrollbar-color: rgba(47, 111, 237, 0.34) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(47, 111, 237, 0.3);
  background-clip: content-box;
  border: 3px solid transparent;
  border-radius: 99px;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(47, 111, 237, 0.5);
  background-clip: content-box;
}
*::-webkit-scrollbar-corner { background: transparent; }
[data-theme="dark"] * { scrollbar-color: rgba(147, 197, 253, 0.26) transparent; }
[data-theme="dark"] *::-webkit-scrollbar-thumb {
  background: rgba(147, 197, 253, 0.24);
  background-clip: content-box;
}
[data-theme="dark"] *::-webkit-scrollbar-thumb:hover {
  background: rgba(147, 197, 253, 0.42);
  background-clip: content-box;
}
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 10px;
}
html, body { margin: 0; min-height: 100%; }
html { --spin: 0deg; }
body {
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--ink);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  -webkit-tap-highlight-color: transparent;
  background-color: #d5e2f4;
}
html::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: #d5e2f4;
  background-image: linear-gradient(180deg, #eef4fc 0%, #d5e2f4 100%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    url("/static/stars.svg?v=22"),
    url("/static/grain.svg?v=22");
  background-size: 720px 720px, 180px 180px;
  opacity: 0.28;
  mix-blend-mode: multiply;
}
[data-theme="dark"] body { background-color: #050a14; }
html[data-theme="dark"]::before {
  background-color: #050a14;
  background-image: linear-gradient(180deg, #0a1528 0%, #07101c 45%, #050a14 100%);
}
[data-theme="dark"] body::after {
  opacity: 0.22;
  mix-blend-mode: multiply;
  filter: none;
}
#app, #modal, #toasts { position: relative; z-index: 1; }

a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 36px 32px 32px;
  box-shadow: 0 30px 70px rgba(11, 31, 59, 0.14);
  animation: modalIn 0.5s var(--ease) both;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 28px;
  height: 56px;
}
.wordmark-mark {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  overflow: hidden;
  position: relative;
}
.wordmark b {
  color: var(--ink);
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.05em;
  font-weight: 700;
}
.wordmark-mark svg,
.brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}
.login-card p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.45;
}
.login-card label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.login-card input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  background: #fbfdff;
  margin-bottom: 16px;
}
.login-card input:focus {
  outline: 2px solid rgba(47, 111, 237, 0.25);
  border-color: var(--blue);
}

.shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  align-items: stretch;
}
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  isolation: isolate;
  overflow: hidden;
  color: #d7e4f7;
  padding: 16px 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #0a1730;
}
.side::before,
.side::after {
  display: none;
}
.side > * { position: relative; z-index: 1; }
.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 0 0 18px;
}
.brand-mark {
  width: 88px;
  height: 88px;
  flex: 0 0 88px;
  overflow: hidden;
  position: relative;
}
.brand b {
  color: #fff;
  flex: 1;
  min-width: 0;
  font-size: 52px;
  line-height: 88px;
  letter-spacing: -0.06em;
  font-weight: 700;
}
.nav-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 10px 12px;
  border-radius: 11px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.nav-btn {
  position: relative;
  font-weight: 600;
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-med),
    transform var(--t-fast);
}
.nav-btn::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 50%;
  width: 3px;
  height: 0;
  border-radius: 99px;
  background: #8ab4ff;
  transform: translateY(-50%);
  transition: height var(--t-med);
}
.nav-btn:hover { background: rgba(255,255,255,0.10); }
.nav-btn:hover:not(.active)::before { height: 14px; }
.nav-btn:active { transform: scale(0.985); }
.nav-btn.active {
  color: #fff;
  border: 0;
  background: var(--grad);
  box-shadow: 0 8px 22px rgba(29, 78, 216, 0.32);
}
.nav-btn.active::before { height: 0; }
.side .spacer { flex: 1; }
.side .logout {
  color: #9fb3d3;
  border: 1px solid rgba(255,255,255,0.08);
}
.clock {
  padding: 0;
  color: #8aa0c2;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.side-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
}
.theme-switch {
  flex: 0 0 52px;
  width: 52px;
  height: 28px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 99px;
  background: rgba(255,255,255,0.08);
  position: relative;
  padding: 0;
}
.theme-switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #eef4ff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: transform 0.35s ease, background 0.35s ease;
}
[data-theme="dark"] .theme-switch {
  background: rgba(47, 111, 237, 0.28);
  border-color: rgba(147, 197, 253, 0.28);
}
[data-theme="dark"] .theme-switch span {
  transform: translateX(24px);
  background: #0b1f3b;
}

.main {
  padding: 22px 28px 40px;
  min-width: 0;
  min-height: 100vh;
  background: transparent;
}
.main[data-enter] > * { animation: rise 0.42s var(--ease) both; }
.main[data-enter] > *:nth-child(2) { animation-delay: 0.06s; }
.main[data-enter] > *:nth-child(3) { animation-delay: 0.12s; }
.main[data-enter] > *:nth-child(4) { animation-delay: 0.18s; }
.main[data-enter] > *:nth-child(n + 5) { animation-delay: 0.24s; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.top h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.16;
  letter-spacing: -0.035em;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.top .sub { color: var(--muted); margin-top: 4px; font-size: 13px; }
.top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.grid {
  display: grid;
  gap: 14px;
}
.grid.kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.kpi.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.two { grid-template-columns: 1.4fr 1fr; align-items: start; }
.grid.two > .card { min-width: 0; }
.grid.form { grid-template-columns: 1fr 1fr; }

.card {
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(215, 227, 244, 0.9);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 12px 30px rgba(11, 31, 59, 0.06);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  transition: box-shadow var(--t-med), transform var(--t-med), border-color var(--t-med);
}
.card.kpi {
  position: relative;
  overflow: hidden;
}
.card.kpi::before {
  content: "";
  position: absolute;
  right: -34px;
  top: -46px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 111, 237, 0.11), transparent 70%);
  pointer-events: none;
}
[data-theme="dark"] .card.kpi::before {
  background: radial-gradient(circle, rgba(96, 165, 250, 0.13), transparent 70%);
}
.card.kpi > * { position: relative; }
.card.kpi::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: var(--grad);
  opacity: 0;
  transition: opacity var(--t-med);
}
.card.kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(11, 31, 59, 0.1);
}
.card.kpi:hover::after { opacity: 1; }
.card h3 {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.kpi .n {
  font-size: 28px;
  letter-spacing: -0.04em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.kpi .n .absent { font-size: 11px; font-weight: 500; letter-spacing: 0.01em; }
.kpi .l { color: var(--muted); margin-top: 4px; font-size: 13px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 11px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: #eef3fa;
  color: var(--ink);
}
.pill.ok {
  border-color: rgba(18, 160, 106, 0.3);
  background: var(--ok-bg);
  color: var(--ok);
}
.pill.ok::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: livePulse 2s ease-out infinite;
}
.pill.warn {
  border-color: #ecd9a8;
  background: var(--warn-bg);
  color: var(--warn);
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(18, 160, 106, 0.55); }
  70% { box-shadow: 0 0 0 6px rgba(18, 160, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(18, 160, 106, 0); }
}
.pill.quiet {
  background: #eef3fa;
  color: var(--muted);
}
.pill.bad {
  background: var(--bad-bg);
  border-color: #f3c4cb;
  color: var(--bad);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.chip {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: #eef3fa;
  color: var(--muted);
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.chip.off::before,
.chip.on::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}
.chip.on {
  border: 0;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.2);
}
.chip.on::before { opacity: 1; box-shadow: 0 0 8px rgba(255, 255, 255, 0.9); }
.status-work {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}
.status-work b { color: var(--ink); font-weight: 650; }

.overview-feed-card.overview-feed-only {
  margin-top: 0;
  min-height: min(78vh, 820px);
}
.overview-feed-card {
  margin-top: 14px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: min(68vh, 720px);
}
.overview-feed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  min-height: 38px;
}
.overview-feed-card .overview-feed-title {
  margin: 0;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 38px;
  flex: 0 0 auto;
}
.feed-chat-pick {
  margin: 0;
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  align-self: center;
}
.feed-select {
  max-width: min(300px, 56vw);
  min-width: 160px;
  height: 38px;
  margin: 0;
  padding: 0 36px 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7c99' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
}
.feed-select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.18);
}
[data-theme="dark"] .feed-select {
  background-color: rgba(8, 16, 32, 0.92);
  color: #e8f0ff;
  border-color: rgba(255, 255, 255, 0.14);
  color-scheme: dark;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239bb0cc' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
}
.feed-select option {
  background: #0f1a2e;
  color: #e8f0ff;
}
.feed-scroll {
  flex: 1;
  min-height: 280px;
  max-height: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  background: rgba(47, 111, 237, 0.02);
}
[data-theme="dark"] .feed-scroll {
  background: rgba(255, 255, 255, 0.03);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.feed-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}
.feed-body {
  flex: 1;
  min-width: 0;
}
.feed-ava {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}
.feed-ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.feed-initial {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.feed-ava img.on { opacity: 1; }
.feed-ava img:not(.on) { opacity: 0.85; }
.svc-list {
  display: flex;
  flex-direction: column;
  margin-top: 4px;
}
.svc-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.svc-row:last-child { border-bottom: 0; padding-bottom: 0; }
.svc-main { min-width: 0; flex: 1; }
.svc-label {
  display: block;
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.svc-note {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.35;
}
.svc-state {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  border: 1px solid transparent;
}
.svc-state.on {
  color: #0d5f40;
  background: var(--ok-bg);
  border-color: #b8e6cf;
}
.svc-state.off {
  color: var(--muted);
  background: #eef3fa;
  border-color: var(--line);
}
[data-theme="dark"] .svc-state.on {
  color: #86efac;
  background: rgba(27, 127, 86, 0.18);
  border-color: rgba(134, 239, 172, 0.25);
}
[data-theme="dark"] .svc-state.off {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar { margin-bottom: 14px; }
.chat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.chat-hero h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  flex-wrap: wrap;
}
.chat-link {
  color: var(--blue);
  word-break: break-all;
}
.chat-link:hover { text-decoration: underline; }

.btn {
  appearance: none;
  border: 1px solid var(--line);
  color: var(--ink);
  height: 38px;
  padding: 0 15px;
  border-radius: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 2px 8px rgba(11, 31, 59, 0.06);
  transition: transform var(--t-fast), box-shadow var(--t-fast),
    background var(--t-fast), border-color var(--t-fast), filter var(--t-fast);
}
.btn:hover {
  border-color: rgba(47, 111, 237, 0.45);
  background: #fff;
  box-shadow: 0 6px 16px rgba(11, 31, 59, 0.1);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(1px) scale(0.99); box-shadow: none; }
.btn.primary,
.btn.ghost-light {
  border: 0;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.24);
}
.btn.primary:hover,
.btn.ghost-light:hover {
  filter: brightness(1.07);
  box-shadow: 0 12px 26px rgba(29, 78, 216, 0.32);
}
.btn.danger {
  border: 1px solid rgba(225, 29, 72, 0.32);
  color: var(--danger);
  background: var(--bad-bg);
  box-shadow: none;
}
.btn.danger:hover {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--danger), var(--danger-2));
  box-shadow: 0 10px 22px rgba(225, 29, 72, 0.28);
}
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink); box-shadow: none; }
.btn.ghost:hover { background: rgba(11, 31, 59, 0.06); box-shadow: none; }
.btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
  box-shadow: none;
  filter: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field span { font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
  background: #fbfdff;
  color: inherit;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.field input:hover, .field select:hover, .field textarea:hover {
  border-color: rgba(47, 111, 237, 0.35);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.16);
}
.field textarea { min-height: 88px; resize: vertical; }

.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  font-size: 11px;
  color: var(--muted);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 251, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.table td {
  padding: 11px 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; transition: background var(--t-fast); }
.table tr.clickable:hover { background: #f2f7ff; }
.table tr.clickable:active { background: #e8f0ff; }
.table.accounts th:nth-child(n+2),
.table.accounts td:nth-child(n+2) {
  text-align: center;
}
.shot-hubs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.shot-hubs .bot-orb { width: 100%; }
.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 14px;
}
.shot-tile {
  appearance: none;
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.86);
  box-shadow: 0 10px 24px rgba(11, 31, 59, 0.06);
  padding: 12px 12px 12px;
  text-align: left;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  overflow: hidden;
}
.shot-art {
  flex: 0 0 auto;
  height: 56px;
  margin: 2px 0 10px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  pointer-events: none;
  overflow: hidden;
  transition: transform var(--t-med);
}
.shot-logo {
  width: auto;
  height: auto;
  max-width: 44px;
  max-height: 44px;
  object-fit: contain;
  object-position: left center;
  pointer-events: none;
}
.shot-tile:hover .shot-art { transform: scale(1.06); }
.shot-meta {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.shot-tile {
  transition: transform var(--t-med), box-shadow var(--t-med), border-color var(--t-med);
}
.shot-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(47, 111, 237, 0.4);
  box-shadow: 0 18px 36px rgba(11, 31, 59, 0.13);
}
.shot-tile:active { transform: translateY(0) scale(0.99); }
.shot-tile.on {
  border-color: rgba(47, 111, 237, 0.6);
  box-shadow: 0 10px 26px rgba(47, 111, 237, 0.2);
}
.shot-tile.on::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(160deg, rgba(47, 111, 237, 0.1), transparent 55%);
}
.shot-bank {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.shot-tile b {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.shot-mark {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue);
  display: none;
  place-items: center;
  box-shadow: 0 4px 10px rgba(47, 111, 237, 0.4);
}
.shot-tile.on .shot-mark { display: grid; animation: markPop 0.32s var(--ease) both; }
@keyframes markPop {
  from { opacity: 0; transform: scale(0.4); }
  to { opacity: 1; transform: scale(1); }
}
.shot-mark::after {
  content: "";
  width: 10px;
  height: 6px;
  border: 2.2px solid #fff;
  border-top: 0;
  border-right: 0;
  transform: rotate(-46deg) translate(0, -1px);
}
[data-theme="dark"] .shot-tile {
  background: rgba(16, 28, 48, 0.72);
  border-color: rgba(255,255,255,0.08);
  color: var(--ink);
}
.acc-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.acc-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.table.accounts tr.acc-dead td.acc-lead {
  position: relative;
  overflow: visible;
  padding-left: 26px;
}
.table.accounts tr.acc-dead { background: rgba(225, 29, 72, 0.035); }
.acc-dismiss {
  position: absolute;
  left: 0;
  top: 50%;
  margin-top: -10px;
  z-index: 3;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid rgba(155, 176, 204, 0.28);
  border-radius: 50%;
  background: rgba(12, 22, 40, 0.78);
  color: rgba(200, 214, 235, 0.72);
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.15s ease, background 0.15s ease;
  box-shadow: none;
}
.acc-dismiss::before,
.acc-dismiss::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 1.5px;
  margin: -0.75px 0 0 -4.5px;
  border-radius: 1px;
  background: currentColor;
}
.acc-dismiss::before { transform: rotate(45deg); }
.acc-dismiss::after { transform: rotate(-45deg); }
.acc-dismiss:hover,
.acc-dismiss:focus-visible {
  opacity: 0.78;
  background: rgba(22, 36, 58, 0.92);
  color: #e8eef8;
  outline: none;
}
.acc-warn {
  display: inline-flex;
  align-items: center;
  flex: 0 0 26px;
  vertical-align: middle;
  margin: 0 0 0 4px;
}
.acc-warn-svg {
  display: block;
  flex-shrink: 0;
}
.acc-ava {
  position: relative;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(160deg, #2a4d86, #163a66);
  color: #dbe8ff;
  font-weight: 700;
  font-size: 15px;
  display: grid;
  place-items: center;
}
.acc-ava::before { content: attr(data-initial); }
.acc-ava img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  opacity: 0;
}
.acc-ava img.on { opacity: 1; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }

.child-row td:first-child { padding-left: 28px; }

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(11, 31, 59, 0.05);
  width: fit-content;
}
.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 11px;
  box-shadow: none;
  transition: color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.tab:hover { color: var(--ink); background: rgba(255, 255, 255, 0.6); }
.tab.active {
  font-weight: 650;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 8px 22px rgba(29, 78, 216, 0.28);
}

.field.wide { grid-column: 1 / -1; }
.secret {
  position: relative;
}
.secret input {
  width: 100%;
  padding-right: 44px;
}
.eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0;
}
.eye::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  margin: 7px auto;
  background: currentColor;
  color: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
}
.eye.on::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3l18 18'/%3E%3Cpath d='M10.6 10.6a2 2 0 102.8 2.8'/%3E%3Cpath d='M6.7 6.7C4.2 8.3 2.5 11 2 12c.8 1.7 4.5 8 10 8 2 0 3.7-.6 5.2-1.6'/%3E%3Cpath d='M13.9 8.2A5 5 0 0012 8c-5.5 0-9.2 6.3-10 8'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3l18 18'/%3E%3Cpath d='M10.6 10.6a2 2 0 102.8 2.8'/%3E%3Cpath d='M6.7 6.7C4.2 8.3 2.5 11 2 12c.8 1.7 4.5 8 10 8 2 0 3.7-.6 5.2-1.6'/%3E%3Cpath d='M13.9 8.2A5 5 0 0012 8c-5.5 0-9.2 6.3-10 8'/%3E%3C/svg%3E") center / contain no-repeat;
}
.eye { color: var(--muted); }
.eye:hover { background: rgba(11, 31, 59, 0.06); }

.bank {
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 8px;
  overflow: hidden;
}
.bank > button.head {
  width: 100%;
  text-align: left;
  border: 0;
  background: #f8fbff;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
}
.bank .body { padding: 8px 12px 12px; display: grid; gap: 6px; }
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  cursor: pointer;
}
.check input { accent-color: var(--blue); }

.feed {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
}
.feed-empty { padding: 12px 0; }
.feed-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
  transition: background var(--t-fast);
}
.feed-item:hover { background: rgba(47, 111, 237, 0.04); }
.feed-item:first-child { padding-top: 2px; }
.feed-item:last-child { border-bottom: 0; padding-bottom: 2px; }
.feed-item.feed-enter {
  animation: feedSlideIn 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes feedSlideIn {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .feed-item.feed-enter { animation: none; }
}
.feed-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 4px;
}
.feed-name {
  font-weight: 650;
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-name-empty { font-weight: 500; }
.feed-time {
  flex-shrink: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.feed-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.48;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.bar-row { display: grid; grid-template-columns: 52px 1fr 40px; gap: 8px; align-items: center; margin: 7px 0; }
.bar {
  height: 8px;
  background: #e7eef8;
  border-radius: 99px;
  overflow: hidden;
}
.bar i { display: block; height: 100%; background: var(--blue); }

.stats-chart-card { margin-top: 14px; padding-bottom: 12px; }
.stats-chart-card h3 {
  margin: 0;
  text-transform: none;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.stats-chart-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.stats-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.stats-periods {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}
.stats-period {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.55);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.stats-period:hover { border-color: var(--blue); color: var(--text); }
.stats-period.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.stats-chart-wrap {
  position: relative;
  width: 100%;
  min-height: 220px;
  margin-top: 4px;
}
.stats-svg {
  width: 100%;
  height: 220px;
  display: block;
  overflow: visible;
  touch-action: pan-y;
}
.stats-grid {
  stroke: rgba(120, 140, 170, 0.22);
  stroke-width: 1;
  stroke-dasharray: 4 6;
}
.stats-area {
  fill: url(#statsAreaGrad);
  animation: fadeIn 0.6s ease both;
}
.stats-line {
  stroke: var(--stats-line);
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
  animation: drawLine 1s var(--ease) forwards;
}
@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}
.stats-dot {
  fill: var(--stats-line);
  stroke: rgba(255,255,255,0.9);
  stroke-width: 2;
  transition: r 0.14s ease;
}
.stats-dot-hit { fill: transparent; pointer-events: all; cursor: pointer; }
.stats-dot-g:hover .stats-dot { r: 5.5; }
.stats-cursor {
  stroke: var(--stats-line);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  opacity: 0;
}
.stats-dot-g:hover .stats-cursor { opacity: 0.55; }
.stats-tip {
  position: absolute;
  z-index: 4;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -125%);
  transition: opacity var(--t-fast);
  box-shadow: 0 10px 24px rgba(8, 18, 36, 0.28);
}
.stats-tip.on { opacity: 1; }
.stats-tip span { display: block; font-weight: 500; opacity: 0.75; font-size: 11px; }
.stats-label {
  font-size: 10px;
  fill: var(--muted);
  font-family: inherit;
}
.stats-chart-foot {
  margin-top: 8px;
  font-size: 12px;
  text-align: center;
}
.stats-empty { padding: 48px 12px; text-align: center; }
.kpi-sub { font-size: 11px; font-weight: 500; opacity: 0.85; }

#modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 18, 36, 0.46);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 20;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease both;
}
#modal[hidden] { display: none; }
.modal-card {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 30px 70px rgba(8, 18, 36, 0.28);
  animation: modalIn 0.28s var(--ease) both;
}
.modal-card.modal-wide {
  width: min(720px, 100%);
  max-height: min(88vh, 860px);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-x {
  appearance: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}
.modal-x:hover {
  background: rgba(255, 255, 255, 0.08);
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.modal-card h3 { margin: 0 0 8px; }
.modal-card p { color: var(--muted); margin: 0 0 16px; line-height: 1.45; }

#toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  z-index: 30;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--navy);
  color: #fff;
  padding: 11px 15px;
  border-radius: 12px;
  min-width: 220px;
  max-width: min(360px, calc(100vw - 36px));
  font-size: 14px;
  line-height: 1.35;
  box-shadow: 0 16px 38px rgba(8, 18, 36, 0.32);
  animation: toastIn 0.32s var(--ease) both;
}
.toast::before {
  content: "";
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8ab4ff;
}
.toast.bad { background: var(--bad); }
.toast.bad::before { background: #ffd0d7; }
.toast.ok { background: #115e3b; }
.toast.ok::before { background: #6ee7b7; }
.toast.leaving { animation: toastOut 0.24s ease forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(24px) scale(0.96); }
}

.empty {
  padding: 28px 8px;
  color: var(--muted);
  text-align: center;
}
.meta {
  display: grid;
  gap: 8px;
}
.meta > div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.meta > div > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  flex: 0 0 auto;
}
.meta > div > span::after { content: ":"; }
.meta b {
  font-weight: 550;
  font-size: 13px;
  min-width: 0;
}
.absent {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: #eef3fa;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 3px 9px;
  line-height: 1.35;
}
.muted .absent { font-weight: 500; }

@media (max-width: 980px) {
  html {
    height: 100%;
    overscroll-behavior: none;
  }
  body {
    padding: 0;
    overflow-x: hidden;
  }
  body::before {
    transform: none;
    filter: blur(18px);
    opacity: 0.22;
  }
  .login-wrap {
    min-height: 100dvh;
    padding:
      calc(20px + env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right))
      calc(20px + env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
  }
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100dvh;
  }
  .side {
    position: sticky;
    top: 0;
    z-index: 50;
    height: auto;
    max-height: none;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    padding:
      calc(8px + env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      10px
      max(10px, env(safe-area-inset-left));
    background: rgba(9, 20, 42, 0.82);
    backdrop-filter: saturate(1.6) blur(22px);
    -webkit-backdrop-filter: saturate(1.6) blur(22px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(3, 9, 20, 0.3);
    scroll-behavior: smooth;
  }
  .side.nav-more {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent);
  }
  .side::-webkit-scrollbar { display: none; }
  .side::before,
  .side::after {
    display: none;
  }
  .brand { width: auto; padding: 0 6px 0 0; flex: 0 0 auto; }
  .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
  .brand b { display: none; }
  .nav-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 38px;
    padding: 8px 13px;
    font-size: 14px;
    letter-spacing: -0.01em;
    color: #a9bcd8;
  }
  .nav-btn.active {
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.38);
  }
  .spacer { display: none; }
  .side-foot {
    flex: 0 0 auto;
    padding-top: 0;
    margin-left: 4px;
  }
  .clock { display: none; }
  .theme-switch { flex: 0 0 48px; width: 48px; }
  .grid.kpi,
  .grid.kpi.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.kpi.three > .card:last-child {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    gap: 10px;
  }
  .grid.kpi.three > .card:last-child .l { margin-top: 0; }
  .grid.two, .grid.form { grid-template-columns: 1fr; }
  .overview-feed-card { min-height: 52vh; }
  .feed-scroll { min-height: 220px; }
  .feed-select { max-width: 100%; width: 100%; }
  .overview-feed-toolbar { align-items: stretch; }
  .feed-chat-pick { width: 100%; }
  .grid.kpi .card { padding: 14px 15px; }
  .kpi .n { font-size: 26px; }
  .kpi .l { font-size: 12px; }
  .card h3 { font-size: 11px; margin-bottom: 10px; }
  .shot-hubs { grid-template-columns: 1fr; }
  .main {
    padding: 16px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    min-height: auto;
  }
  .top {
    align-items: flex-start;
    margin-bottom: 14px;
  }
  .top h2 { font-size: 21px; }
  .top-actions { flex: 1 1 auto; }
  .top-actions .btn { padding: 0 16px; }
  .top-actions .btn.danger { margin-left: auto; }
  .card { border-radius: 18px; }
  .btn { min-height: 44px; border-radius: 13px; }
  .main .card:has(.table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .feed { max-height: none; overflow: visible; }
  .feed-item { overflow-wrap: anywhere; }
  .stats-chart-head { gap: 10px; }
  .stats-periods { width: 100%; }
  .stats-period { flex: 1 1 auto; text-align: center; min-height: 36px; }
  .shot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .modal-card { border-radius: 16px; padding: 18px; }
  #toasts {
    right: 12px;
    left: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .toast { max-width: none; }
  .orbit.hubs {
    grid-template-columns: 1fr;
    padding: 24px 16px 32px;
    gap: 20px;
  }
  .orbit.leaves {
    padding: 24px 16px 32px;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .main .card:has(.table.stacked) {
    overflow-x: visible;
    padding: 10px;
  }
  .table.stacked,
  .table.stacked tbody,
  .table.stacked tr,
  .table.stacked td {
    display: block;
    width: 100%;
  }
  .table.stacked thead { display: none; }
  .table.stacked tr {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px 13px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.55);
  }
  .table.stacked tr:last-child { margin-bottom: 0; }
  .table.stacked td {
    border: 0;
    padding: 0;
    text-align: left !important;
  }
  .table.stacked td.acc-lead,
  .table.stacked td.row-lead { margin-bottom: 6px; }
  .table.stacked td:not(.acc-lead):not(.row-lead) {
    display: inline-flex;
    width: auto;
    max-width: 100%;
    align-items: center;
    gap: 6px;
    margin: 6px 12px 0 0;
    font-size: 12px;
    color: var(--muted);
    overflow-wrap: anywhere;
  }
  .table.stacked td[data-th]:not(.acc-lead):not(.row-lead)::before {
    content: attr(data-th);
    flex: 0 0 auto;
    font-size: 10px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.65;
  }
  .table.stacked td.empty {
    display: block;
    margin: 0;
    font-size: 13px;
    text-align: center !important;
  }
  .table.stacked tr:has(td.empty) { background: transparent; border: 0; }
  .table.accounts tr.acc-dead td.acc-lead { padding-left: 0; }
  .acc-dismiss { left: auto; right: 2px; top: 2px; margin-top: 0; }
  .child-row td:first-child { padding-left: 0; }
  [data-theme="dark"] .table.stacked tr {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { --spin: 0deg !important; }
  body::before { transform: none !important; }
  .side::before { transform: none !important; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.main.stage {
  position: relative;
  padding: 0 !important;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: auto;
  background: transparent !important;
  box-shadow: none;
  border: 0;
}
.stage-bar {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 6;
  margin: 0;
}
.orbit {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 100vh;
  overflow: visible;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}
.orbit.hubs {
  display: grid;
  grid-template-columns: repeat(3, minmax(210px, 240px));
  justify-content: center;
  align-content: center;
  gap: 36px 48px;
  padding: 48px 40px 64px;
}
.orbit.leaves {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  align-content: start;
  gap: 22px 24px;
  padding: 56px 32px 48px;
}
.bot-orb,
.sc-leaf {
  position: relative;
  left: auto;
  top: auto;
  width: auto;
  transform: none;
  animation: rise 0.5s var(--ease) both;
  border: 1px solid rgba(215, 227, 244, 0.95);
  background: rgba(255,255,255,0.86);
  box-shadow: 0 18px 40px rgba(11, 31, 59, 0.08);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  text-align: left;
  color: var(--ink);
  overflow: hidden;
  transition: transform var(--t-med), box-shadow var(--t-med), border-color var(--t-med);
}
.bot-orb::after,
.sc-leaf::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--grad);
  opacity: 0;
  transition: opacity var(--t-med);
  pointer-events: none;
  mix-blend-mode: soft-light;
}
.orbit > *:nth-child(1),
.shot-hubs > *:nth-child(1) { animation-delay: 0.02s; }
.orbit > *:nth-child(2),
.shot-hubs > *:nth-child(2) { animation-delay: 0.06s; }
.orbit > *:nth-child(3),
.shot-hubs > *:nth-child(3) { animation-delay: 0.1s; }
.orbit > *:nth-child(4) { animation-delay: 0.14s; }
.orbit > *:nth-child(5) { animation-delay: 0.18s; }
.orbit > *:nth-child(6) { animation-delay: 0.22s; }
.orbit > *:nth-child(n + 7) { animation-delay: 0.26s; }
.bot-orb {
  width: 100%;
  padding: 18px 18px 16px;
  border-radius: 28px;
}
.sc-leaf {
  width: 100%;
  padding: 14px 16px 13px;
  border-radius: 22px;
}
.bot-orb:hover,
.sc-leaf:hover {
  transform: translateY(-4px);
  border-color: rgba(47, 111, 237, 0.4);
  box-shadow: 0 26px 52px rgba(11, 31, 59, 0.14);
  z-index: 3;
}
.bot-orb:hover::after,
.sc-leaf:hover::after { opacity: 0.16; }
.bot-orb:active,
.sc-leaf:active { transform: translateY(-1px) scale(0.995); }
.bot-orb-k,
.sc-leaf span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.bot-orb b,
.sc-leaf b {
  display: block;
  margin: 8px 0 4px;
  font-size: 18px;
  letter-spacing: -0.03em;
  font-weight: 700;
}
.bot-orb em,
.sc-leaf em {
  display: block;
  font-style: normal;
  color: var(--muted);
  font-size: 13px;
}
.bot-orb i {
  display: block;
  margin-top: 10px;
  font-style: normal;
  font-size: 12px;
  color: var(--blue);
  font-weight: 600;
}
.thread-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 8px 28px;
}
.rail-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}
.rail-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px 0 24px;
  padding-right: 140px;
  flex: 0 0 auto;
}
.thread-title {
  display: block;
  flex: 1;
  min-width: 0;
  width: auto;
  margin: 0;
  border: 0;
  background: transparent;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--ink);
  outline: none;
}
.silk-rail {
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  align-items: center;
  padding: 8px 0 28px;
}
.silk-rail::-webkit-scrollbar { height: 8px; }
.silk-rail::-webkit-scrollbar-thumb {
  background: rgba(91, 147, 255, 0.35);
  border-radius: 99px;
}
.silk-track {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-start;
  gap: 36px;
  min-width: max-content;
  min-height: 420px;
  height: 420px;
  padding: 24px 72px;
}
.silk-curve {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}
.silk-curve path {
  fill: none;
  stroke: url(#silkGrad);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px rgba(79, 140, 255, 0.55));
}
.silk {
  position: relative;
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 18px 0 40px;
}
.bead {
  position: relative;
  z-index: 1;
  flex: 0 0 220px;
  width: 220px;
  margin: 0;
  padding: 16px 16px 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(215,227,244,0.95);
  box-shadow: 0 10px 24px rgba(11,31,59,0.08);
  color: var(--ink);
  will-change: transform;
}
.bead[data-lane="-1"] { margin-top: 18px; }
.bead[data-lane="0"] { margin-top: 148px; }
.bead[data-lane="1"] { margin-top: 278px; }
.bead span,
.bubble-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.bead b {
  display: block;
  margin-top: 6px;
  font-size: 15px;
}
.bubble {
  width: min(390px, calc(50% - 28px));
  margin: 0 0 18px calc(50% + 24px);
  padding: 12px 14px 10px;
  border-radius: 22px 22px 22px 8px;
  background: linear-gradient(180deg, #fff, #eef4ff);
  border: 1px solid rgba(215,227,244,0.95);
  box-shadow: 0 12px 28px rgba(11,31,59,0.08);
}
.bubble.left {
  margin-left: 0;
  margin-right: calc(50% + 24px);
  border-radius: 22px 22px 8px 22px;
  background: linear-gradient(180deg, #fff, #f7fbff);
}
.bubble.actor { background: linear-gradient(180deg, #fff, #e8f0ff); }
.bubble.review { box-shadow: 0 12px 28px rgba(47,111,237,0.18); }
.bubble-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.bubble-meta input {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  width: 64px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
}
.bubble-meta input[name="who"] { width: 140px; flex: 1; }
.bubble textarea {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  border: 0;
  background: transparent;
  outline: none;
  color: var(--ink);
  line-height: 1.4;
}
.reply-chip {
  margin-top: 4px;
  font-size: 11px;
  color: var(--blue);
  font-weight: 600;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 980px) {
  .orbit.hubs { grid-template-columns: 1fr; align-content: start; padding: 20px 16px 28px; }
  .orbit.leaves { grid-template-columns: 1fr 1fr; padding: 20px 16px 28px; }
  .silk-track { gap: 22px; padding: 24px 28px; }
  .bead { flex-basis: 190px; width: 190px; }
  .main.stage { min-height: 0; }
  .orbit { min-height: 0; }
  .stage-bar { top: 10px; right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8eef8;
  --muted: #9bb0cc;
  --line: rgba(215, 227, 244, 0.12);
}
[data-theme="dark"] .login-card,
[data-theme="dark"] .modal-card {
  background: rgba(16, 28, 48, 0.92);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--ink);
}
[data-theme="dark"] .login-card input,
[data-theme="dark"] .field input,
[data-theme="dark"] .field select,
[data-theme="dark"] .field textarea,
[data-theme="dark"] .bubble-meta input,
[data-theme="dark"] .bubble textarea,
[data-theme="dark"] .modal-card input,
[data-theme="dark"] .modal-card select,
[data-theme="dark"] .modal-card textarea,
[data-theme="dark"] .ai-account-form input,
[data-theme="dark"] .ai-account-form textarea,
[data-theme="dark"] .ai-search,
[data-theme="dark"] .ai-acc-filter,
[data-theme="dark"] .ai-settings-form input,
[data-theme="dark"] .ai-settings-form select {
  background: #0d1728;
  color: #e8eef8;
  border-color: rgba(255,255,255,0.14);
}
[data-theme="dark"] .modal-card input::placeholder,
[data-theme="dark"] .modal-card textarea::placeholder,
[data-theme="dark"] .ai-account-form input::placeholder,
[data-theme="dark"] .ai-account-form textarea::placeholder {
  color: #8aa0bd;
}
[data-theme="dark"] {
  --stats-line: #60a5fa;
}
[data-theme="dark"] .stats-period:not(.active) {
  background: rgba(20, 32, 52, 0.65);
  border-color: rgba(120, 150, 200, 0.25);
}
[data-theme="dark"] .stats-dot {
  stroke: rgba(15, 23, 42, 0.9);
}
[data-theme="dark"] .card,
[data-theme="dark"] .bot-orb,
[data-theme="dark"] .sc-leaf,
[data-theme="dark"] .bubble {
  background: rgba(16, 28, 48, 0.72);
  border-color: rgba(255,255,255,0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 14px 34px rgba(2, 8, 20, 0.36);
  color: var(--ink);
}
[data-theme="dark"] .bead {
  background: #102038;
  border-color: rgba(255,255,255,0.12);
  color: #e8eef8;
}
[data-theme="dark"] .btn.primary,
[data-theme="dark"] .btn.danger { color: #fff; }
[data-theme="dark"] .table th {
  color: var(--muted);
}
[data-theme="dark"] .table tr.clickable:hover {
  background: rgba(255,255,255,0.04);
}
[data-theme="dark"] .acc-dismiss {
  background: rgba(8, 16, 32, 0.88);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(215, 228, 247, 0.7);
}
[data-theme="dark"] .acc-dismiss:hover,
[data-theme="dark"] .acc-dismiss:focus-visible {
  background: rgba(24, 40, 64, 0.95);
  color: #f0f4fc;
}
[data-theme="dark"] .wordmark b,
[data-theme="dark"] .login-card label {
  color: var(--ink);
}
[data-theme="dark"] .orbit {
  background: transparent;
  border: 0;
}
[data-theme="dark"] .pill.quiet,
[data-theme="dark"] .chip:not(.on),
[data-theme="dark"] .absent {
  background: rgba(10, 23, 48, 0.4);
  border-color: rgba(255,255,255,0.1);
  color: #9bb0cc;
}
[data-theme="dark"] .pill:not(.ok):not(.warn):not(.bad) {
  color: #d7e4f7;
  border-color: rgba(255,255,255,0.1);
  background: rgba(10, 23, 48, 0.48);
}
[data-theme="dark"] .pill.ok {
  background: rgba(18, 160, 106, 0.18);
  border-color: rgba(18, 160, 106, 0.4);
  color: #5ee3ad;
}
[data-theme="dark"] .pill.ok::before {
  animation-name: livePulseDark;
}
@keyframes livePulseDark {
  0% { box-shadow: 0 0 0 0 rgba(94, 227, 173, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(94, 227, 173, 0); }
  100% { box-shadow: 0 0 0 0 rgba(94, 227, 173, 0); }
}
[data-theme="dark"] .pill.warn {
  background: rgba(234, 179, 8, 0.16);
  border-color: rgba(234, 179, 8, 0.34);
  color: #f2cf6a;
}
[data-theme="dark"] .pill.bad {
  background: rgba(180, 35, 56, 0.22);
  border-color: rgba(243, 196, 203, 0.28);
  color: #f3c4cb;
}
[data-theme="dark"] .btn:not(.primary):not(.danger):not(.ghost):not(.ghost-light) {
  background: rgba(20, 34, 58, 0.72);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e8eef8;
}
[data-theme="dark"] .btn:not(.primary):not(.danger):not(.ghost):not(.ghost-light):hover {
  background: rgba(30, 48, 78, 0.9);
  border-color: rgba(120, 165, 255, 0.45);
}
[data-theme="dark"] .btn.danger {
  background: rgba(225, 29, 72, 0.16);
  border-color: rgba(225, 29, 72, 0.4);
  color: #ff8fa6;
}
[data-theme="dark"] .btn.danger:hover { color: #fff; }
[data-theme="dark"] .tabs { background: rgba(255, 255, 255, 0.05); }
[data-theme="dark"] .tab:hover:not(.active) { background: rgba(255, 255, 255, 0.07); }
[data-theme="dark"] .table th { background: rgba(14, 25, 44, 0.92); }
[data-theme="dark"] .table.accounts tr.acc-dead { background: rgba(225, 29, 72, 0.07); }
[data-theme="dark"] .status-work { color: #9bb0cc; }
[data-theme="dark"] .status-work b { color: #e8eef8; }
[data-theme="dark"] .chat-link { color: #d5e6ff; }
[data-theme="dark"] .btn.ghost { color: #fff; }
[data-theme="dark"] .eye:hover { background: rgba(255,255,255,0.08); }
[data-theme="dark"] .bank > button.head {
  background: rgba(8, 16, 32, 0.55);
  color: var(--ink);
}
[data-theme="dark"] .bar { background: rgba(255,255,255,0.08); }
[data-theme="dark"] .bot-orb,
[data-theme="dark"] .sc-leaf {
  border-color: rgba(255,255,255,0.16);
  background: rgba(12, 24, 44, 0.72);
  box-shadow: 0 18px 40px rgba(11, 31, 59, 0.18);
  color: #e8eef8;
}

.ai-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 14px;
  align-items: start;
}
.ai-side {
  padding: 14px 16px;
  max-height: min(78vh, 720px);
  overflow: auto;
}
.ai-side-h {
  margin: 14px 0 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.72;
}
.ai-kv {
  display: grid;
  gap: 6px;
  font-size: 13px;
}
.ai-kv > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.ai-kv > div span:last-child {
  text-align: right;
  max-width: 58%;
}
.ai-facts {
  display: grid;
  gap: 6px;
  font-size: 13px;
}
.ai-summary {
  font-size: 13px;
  line-height: 1.45;
  margin: 8px 0 0;
}
.ai-persona-card {
  margin-bottom: 14px;
  padding: 14px 16px;
}
.feed-item.feed-link:hover {
  background: rgba(11, 31, 59, 0.04);
}
[data-theme="dark"] .feed-item.feed-link:hover {
  background: rgba(255, 255, 255, 0.05);
}
.feed-preview {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.toolbar .btn.ghost-light.active {
  border-color: rgba(11, 31, 59, 0.35);
  background: rgba(11, 31, 59, 0.08);
}
@media (max-width: 960px) {
  .ai-layout {
    grid-template-columns: 1fr;
  }
  .ai-side {
    max-height: none;
  }
}
.ai-settings-form {
  display: grid;
  gap: 10px;
  max-width: 420px;
}
.ai-settings-form label {
  font-size: 13px;
  opacity: 0.85;
}
.ai-dialog-toolbar {
  flex-wrap: wrap;
  gap: 8px;
}
.ai-dialog-actions {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}
.ai-pack-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 8px;
}
.ai-pack-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.main.ai-messenger-mode {
  padding: 12px 14px 14px;
  min-height: 0;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ai-msg-app {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(11, 31, 59, 0.1);
  background: var(--card, #fff);
  box-shadow: 0 8px 32px rgba(11, 31, 59, 0.06);
}
[data-theme="dark"] .ai-msg-app {
  border-color: rgba(255, 255, 255, 0.08);
  background: #0c182c;
  box-shadow: none;
}
.ai-msg-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid rgba(11, 31, 59, 0.08);
  background: rgba(11, 31, 59, 0.02);
}
[data-theme="dark"] .ai-msg-side {
  border-right-color: rgba(255, 255, 255, 0.08);
  background: #0a1424;
}
.ai-msg-side-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  padding: 12px;
  align-items: center;
}
.ai-search {
  width: 100%;
  min-width: 0;
}
.ai-acc-filter {
  max-width: 140px;
}
.ai-msg-tabs {
  display: flex;
  gap: 6px;
  padding: 0 12px 8px;
}
.ai-msg-tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}
.ai-msg-tab.active {
  background: rgba(47, 111, 237, 0.12);
  color: var(--blue, #2f6fed);
}
.ai-thread-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ai-thread,
.ai-acc-row {
  display: flex;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 10px 10px;
  border-radius: 12px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.ai-thread:hover,
.ai-acc-row:hover {
  background: rgba(11, 31, 59, 0.05);
}
.ai-thread.active {
  background: rgba(47, 111, 237, 0.14);
}
.ai-thread-ava {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(47, 111, 237, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.ai-thread-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ai-thread-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.ai-thread-top time {
  font-size: 11px;
  opacity: 0.7;
  flex-shrink: 0;
}
.ai-thread-preview {
  font-size: 13px;
  opacity: 0.82;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-msg-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.ai-chat-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(11, 31, 59, 0.08);
  flex-wrap: wrap;
}
.ai-chat-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ai-chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  background: rgba(11, 31, 59, 0.02);
}
[data-theme="dark"] .ai-chat-scroll {
  background: #081018;
}
.ai-chat-empty-state {
  margin: auto;
  padding: 48px 32px;
  text-align: center;
  max-width: 360px;
}
.ai-chat-empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(47, 111, 237, 0.12);
  border: 2px solid rgba(47, 111, 237, 0.25);
}
.ai-modal-account {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(88vh, 860px);
}
.ai-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  flex: 0 0 auto;
}
.ai-modal-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-modal-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.ai-modal-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 20px 18px;
  border-top: 1px solid var(--line);
  background: inherit;
}
.ai-modal-peer {
  max-width: 480px;
}
.msg-row {
  display: flex;
  flex-direction: column;
  max-width: 78%;
}
.msg-row.msg-in {
  align-self: flex-start;
}
.msg-row.msg-out {
  align-self: flex-end;
  align-items: flex-end;
}
.msg-bubble {
  padding: 10px 12px;
  border-radius: 16px;
  line-height: 1.45;
  font-size: 14px;
  word-break: break-word;
}
.msg-in .msg-bubble {
  background: rgba(11, 31, 59, 0.07);
  border-bottom-left-radius: 4px;
}
.msg-out .msg-bubble {
  background: rgba(47, 111, 237, 0.18);
  border-bottom-right-radius: 4px;
}
[data-theme="dark"] .msg-in .msg-bubble {
  background: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .msg-out .msg-bubble {
  background: rgba(47, 111, 237, 0.35);
}
.msg-time {
  font-size: 11px;
  margin-top: 2px;
  padding: 0 4px;
}
.ai-account-form {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  align-content: start;
  overflow-y: auto;
  padding: 4px 20px 12px;
  min-height: 0;
  flex: 1;
}
.ai-account-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.ai-account-form input,
.ai-account-form textarea {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
  background: #fbfdff;
  color: inherit;
  width: 100%;
}
.ai-account-form textarea {
  min-height: 72px;
  resize: vertical;
}
@media (max-width: 960px) {
  .main.ai-messenger-mode {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .ai-msg-app {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 38vh) minmax(320px, 1fr);
    min-height: 70vh;
  }
  .ai-msg-side {
    border-right: 0;
    border-bottom: 1px solid rgba(11, 31, 59, 0.08);
  }
}
