@import url("https://fonts.googleapis.com/css2?family=Pangolin&display=swap");

:root {
  --bg: #120b18;
  --bg-2: #1a1024;
  --surface: rgba(18, 12, 28, 0.86);
  --accent: #e84cff;
  --accent-2: #ff4db8;
  --accent-deep: #a855f7;
  --glow: rgba(232, 76, 255, 0.55);
  --glow-pink: rgba(255, 77, 184, 0.45);
  --text: #fff;
  --muted: #9a8aa8;
  --danger: #ff6b9a;
  --ok: #5eead4;
  --warn: #fbbf24;
}

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

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

:focus, :active {
  outline: none;
}

html, body {
  height: 100%;
  width: 100%;
  font-size: 14px;
  line-height: 1.4;
  -ms-touch-action: manipulation;
  touch-action: manipulation;
}

body {
  font-family: "Pangolin", cursive;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

input, button, textarea, select {
  font-family: inherit;
}

button {
  cursor: pointer;
}

ul li {
  list-style: none;
}

button,
.nav-btn,
.header__button,
.card,
.btn,
input,
textarea,
select {
  transition: 0.35s all ease;
}

.hidden { display: none !important; }

/* ========== ROOMS ========== */
.rooms-wrap {
  min-height: 100vh;
  padding: 28px 20px 60px;
}

.rooms-shell {
  width: min(1100px, 100%);
  margin: 0 auto;
}

.rooms-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.rooms-head .logo-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rooms-title {
  font-family: "Pangolin", cursive;
  color: var(--accent);
  font-size: 42px;
  font-weight: 400;
  text-shadow: 0 0 18px var(--glow);
  margin-bottom: 8px;
}

.rooms-lead {
  max-width: 640px;
  margin-bottom: 16px;
}

.rooms-empty {
  color: var(--muted);
  margin-bottom: 18px;
  max-width: 520px;
}

.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.room-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 18px;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 0 20px #000;
  text-align: left;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.room-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: var(--room-color, var(--accent));
  box-shadow: 0 0 16px var(--room-color, var(--glow));
}

.room-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 24px var(--room-color, var(--glow));
}

button.room-card {
  font: inherit;
  width: 100%;
}

.room-card__name {
  font-size: 22px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-card__badge {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 100px;
  background: rgba(251, 191, 36, 0.2);
  color: var(--warn);
}

.room-card__meta {
  color: var(--muted);
  font-size: 13px;
  flex: 1;
}

.room-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.room-card--new {
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(232, 76, 255, 0.45);
  background: rgba(232, 76, 255, 0.06);
}

.room-card--new:hover {
  background: rgba(232, 76, 255, 0.12);
}

.room-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.room-color {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  box-shadow: 0 0 10px currentColor;
}

.room-color.is-on {
  border-color: #fff;
  transform: scale(1.12);
}

.room-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px 0 10px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  max-width: 180px;
}

.room-chip i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--room-color, var(--accent));
  box-shadow: 0 0 10px var(--room-color, var(--glow));
  flex-shrink: 0;
}

.room-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-chip:hover {
  background: rgba(232, 76, 255, 0.2);
}

@media (max-width: 900px) {
  .header {
    padding: 0 12px;
    gap: 8px;
  }
  .room-chip {
    max-width: 140px;
    padding: 0 10px 0 8px;
  }
}

.muted {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.error {
  color: var(--danger);
  min-height: 1.2em;
  font-size: 14px;
  animation: light-accent 2.5s ease-in-out infinite;
}

.mono {
  font-family: "Pangolin", cursive;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
  color: #d4c4e8;
  line-height: 1.55;
}

.row { display: flex; align-items: center; flex-wrap: wrap; }
.gap { gap: 10px; }
.block { margin-top: 16px; }

@keyframes light-accent {
  0% { text-shadow: 0px 0px 0px var(--accent); }
  50% { text-shadow: 0px 0px 24px var(--accent-2); }
  100% { text-shadow: 0px 0px 0px var(--accent); }
}

@keyframes light-white {
  0% { text-shadow: 0px 0px 0px #fff; }
  50% { text-shadow: 0px 0px 24px #fff; }
  100% { text-shadow: 0px 0px 0px #fff; }
}

@keyframes load {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========== LOGIN ========== */
.login-wrap {
  min-height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.login-wrap::before {
  content: "";
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 76, 255, 0.22), transparent 68%);
  top: -80px;
  right: -60px;
  pointer-events: none;
}

.login-wrap::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 77, 184, 0.16), transparent 70%);
  bottom: -40px;
  left: -40px;
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 36px 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0px 0px 40px var(--glow);
}

.logo-block {
  position: relative;
  width: 100%;
  margin-bottom: 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.persona-avatar {
  flex-shrink: 0;
  border-radius: 100px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(232, 76, 255, 0.22);
  box-shadow: inset 0 0 16px rgba(10, 10, 10, 0.54);
}

.persona-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  transform: scale(1.05) translateY(8px);
}

.persona-avatar--login {
  width: 80px;
  height: 80px;
}

.persona-avatar--header {
  width: 50px;
  height: 50px;
}

.logo-main,
.login-card .logo-main {
  font-family: "Pangolin", cursive, system-ui;
  color: var(--accent);
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-align: center;
  text-shadow: 0 0 16px var(--glow);
}

/* ========== HEADER ========== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 32px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 80px;
  background: rgba(16, 10, 24, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 30;
  box-shadow: 0px 0px 20px #000;
  gap: 16px;
}

.header__left {
  position: relative;
  flex-shrink: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header__left p {
  font-family: "Pangolin", cursive, system-ui;
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
  margin: 0;
  letter-spacing: 0.08em;
  text-shadow: 0 0 14px var(--glow);
}

.header__middle {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  flex: 1;
}

.header__button,
.nav-btn {
  font-family: "Pangolin", cursive;
  font-size: 15px;
  width: fit-content;
  position: relative;
  cursor: pointer;
  background: transparent;
  border: none;
  color: #fff;
  padding: 4px 2px;
}

.header__button:hover {
  opacity: 0.7;
  transform: translateY(2px);
}

.header__button-active,
.nav-btn.active {
  color: var(--accent);
  opacity: 1;
  text-shadow: 0 0 12px var(--glow);
}

.header__right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header__order {
  min-width: 40px;
  height: 40px;
  padding: 0 16px;
  border-radius: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.17);
  cursor: pointer;
  border: none;
  color: #fff;
  font-family: "Pangolin", cursive;
  font-size: 14px;
}

.header__order:hover {
  background: var(--accent);
  box-shadow: 0px 0px 16px var(--accent-2);
}

.live-pill {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  letter-spacing: 0.04em;
}

.live-pill.is-on {
  color: #fff;
  background: rgba(94, 234, 212, 0.18);
  box-shadow: 0 0 12px rgba(94, 234, 212, 0.25);
}

.live-pill.is-wait {
  color: #fff;
  background: rgba(232, 76, 255, 0.2);
}

/* ========== LAYOUT ========== */
.app {
  min-height: 100%;
}

.content {
  padding: 80px 0 0;
  min-height: 100vh;
}

.container {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.page-header__left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.page-title,
.page-header h2,
h2.page-title {
  font-family: "Pangolin", cursive !important;
  color: var(--accent);
  font-size: 34px;
  line-height: 1.15;
  text-transform: none;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-shadow: 0px 0px 14px var(--glow);
}

h3 {
  font-family: "Pangolin", cursive !important;
  color: var(--accent);
  font-size: 20px;
  font-weight: 400;
  margin: 0 0 12px;
}

.acc-view-toggle {
  appearance: none;
  background: transparent;
  border: none;
  padding: 0 0 2px;
  margin: 0;
  color: #fff;
  font-size: 12px;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px dashed #fff;
  border-radius: 0;
  align-self: flex-end;
  margin-bottom: 6px;
  opacity: 0.92;
}

.acc-view-toggle:hover {
  color: var(--accent-2);
}

.count-pill {
  font-family: "Pangolin", cursive;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 32px;
  padding: 0 14px;
  border-radius: 100px;
  background: rgba(232, 76, 255, 0.18);
  color: #fff;
  font-size: 15px;
  box-shadow: 0 0 12px var(--glow-pink);
}

.acc-hint {
  margin: -6px 0 18px;
}

#page-accounts.is-archive-view #acc-upload-open,
#page-accounts.is-archive-view #acc-connect-all,
#page-accounts.is-archive-view #acc-disconnect-all,
#page-accounts.is-archive-view #acc-health {
  display: none !important;
}

/* ========== CONTROLS ========== */
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
  background: #1c1428;
  border: 0 solid transparent;
  color: #fff;
  border-radius: 20px;
  padding: 12px 16px;
  font-family: "Pangolin", cursive;
  font-size: 14px;
  width: 100%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

input:hover,
textarea:hover,
select:hover {
  box-shadow: 0px 0px 10px rgba(255, 255, 255, 0.2);
}

input:focus,
textarea:focus,
select:focus {
  box-shadow: 0px 0px 10px var(--accent);
  background: #1c1428;
}

input::placeholder,
textarea::placeholder {
  color: #6b5a7a;
}

.btn {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 10px 18px;
  cursor: pointer;
  font-family: "Pangolin", cursive;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0px 0px 10px rgba(255, 255, 255, 0.25);
  transform: translateY(1px);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
}

.btn.primary:hover {
  box-shadow: 0px 0px 16px var(--accent-2);
  filter: brightness(1.05);
}

.btn.danger {
  background: rgba(255, 77, 184, 0.12);
  color: var(--accent-2);
}

.btn.danger:hover {
  background: var(--accent-2);
  color: #fff;
  box-shadow: 0px 0px 16px var(--accent-2);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.file-btn {
  display: inline-flex;
  cursor: pointer;
}

.btn-icon-round {
  appearance: none;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-icon-round:hover {
  background: rgba(232, 76, 255, 0.22);
  border-color: rgba(232, 76, 255, 0.55);
  box-shadow: 0 0 12px var(--glow);
}

.btn-sm {
  font-size: 12px;
  padding: 6px 10px;
  line-height: 1.2;
}

.chip {
  background: rgba(255, 255, 255, 0.06);
  color: #cfc0dc;
  border: none;
  border-radius: 100px;
  padding: 8px 12px;
  font-size: 13px;
  white-space: nowrap;
}

.chip.is-on {
  background: rgba(232, 76, 255, 0.22);
  color: #fff;
  box-shadow: 0 0 12px var(--glow);
}

/* ========== CARDS / TABLE ========== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.dash-params-row--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dash-params-row--5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.card {
  background: var(--surface);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0px 0px 20px #000;
}

.card:hover {
  box-shadow: 0px 0px 24px var(--glow);
}

.card-label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.card-value {
  font-size: 22px;
  color: #fff;
  line-height: 1.3;
}

.flag-on { color: var(--ok); }
.flag-bad { color: var(--danger); }

.table-wrap {
  margin-top: 16px;
  overflow: auto;
  border-radius: 20px;
  background: #1c1428;
  box-shadow: 0px 0px 20px #000;
}

.table-wrap.table-scroll {
  max-height: 500px;
  overflow-y: auto;
}

.table-wrap.table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #fff;
  vertical-align: middle;
}

th {
  background: #140c1c;
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
}

tr:hover td {
  background: rgba(232, 76, 255, 0.04);
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 13px;
  color: #c2c2c2;
}

.badge.ok { color: #fff; background: rgba(94, 234, 212, 0.2); }
.badge.warn { color: #fff; background: rgba(251, 191, 36, 0.2); }
.badge.bad { color: #fff; background: rgba(255, 77, 184, 0.22); }
.badge.idle { color: #cfc0dc; }

.status-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.st-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.st-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  flex-shrink: 0;
}

.st-pill.live-online {
  color: #5eead4;
  background: rgba(94, 234, 212, 0.14);
}
.st-pill.live-connecting {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.14);
}
.st-pill.live-error,
.st-pill.live-invalid {
  color: #ff8ab8;
  background: rgba(255, 77, 184, 0.14);
}
.st-pill.live-offline {
  color: #cfc0dc;
  background: rgba(255, 255, 255, 0.05);
}

.st-pill.issue-dead {
  color: #ffd0e0;
  background: rgba(255, 60, 120, 0.22);
  box-shadow: 0 0 12px rgba(255, 60, 120, 0.28);
}
.st-pill.issue-spam {
  color: #ffe0c2;
  background: rgba(255, 159, 67, 0.22);
  box-shadow: 0 0 12px rgba(255, 159, 67, 0.25);
}
.st-pill.issue-flood {
  color: #fff3c4;
  background: rgba(251, 191, 36, 0.2);
}
.st-pill.issue-frozen {
  color: #e4d7ff;
  background: rgba(167, 139, 250, 0.22);
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.28);
}
.st-pill.issue-banned {
  color: #ffd4d4;
  background: rgba(255, 70, 70, 0.22);
  box-shadow: 0 0 12px rgba(255, 70, 70, 0.28);
}
.st-pill.issue-error {
  color: #ffd0e8;
  background: rgba(255, 77, 184, 0.16);
}

.acc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 14px;
}

.acc-legend:empty {
  display: none;
}

.status-note {
  font-size: 11px;
  color: var(--muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acc-detail-issue {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 77, 184, 0.12);
  color: #ffd0e8;
}

.acc-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.acc-avatar,
.dlg-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(232, 76, 255, 0.45), rgba(255, 77, 184, 0.35));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 14px;
  color: #fff;
  text-transform: uppercase;
}

.acc-avatar--lg {
  width: 64px;
  height: 64px;
  font-size: 22px;
}

.acc-avatar img,
.dlg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.acc-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ========== INBOX ========== */
.page--inbox {
  display: flex;
  height: calc(100vh - 80px);
  min-height: 0;
}

.inbox-list {
  width: min(380px, 38vw);
  min-width: 280px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  background: rgba(14, 8, 20, 0.55);
}

.inbox-list__tools {
  padding: 16px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.inbox-filters {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inbox-filters select {
  flex: 1;
  padding: 8px 28px 8px 12px;
  border-radius: 14px;
}

.inbox-empty {
  padding: 28px 18px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.dialog-list {
  overflow-y: auto;
  flex: 1;
}

.dlg-item {
  width: 100%;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  padding: 12px 14px;
  background: transparent;
  color: inherit;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.dlg-item:hover {
  background: rgba(232, 76, 255, 0.08);
}

.dlg-item.is-active {
  background: rgba(232, 76, 255, 0.16);
  box-shadow: inset 3px 0 0 var(--accent);
}

.dlg-item__body {
  min-width: 0;
}

.dlg-item__top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.dlg-item__name {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dlg-item__time {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}

.dlg-item__preview {
  font-size: 13px;
  color: #b7a6c8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.dlg-item__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.dlg-acc {
  font-size: 10px;
  color: var(--accent-2);
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unread-dot {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 100px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px var(--glow);
}

.inbox-thread {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: radial-gradient(1200px 400px at 80% -10%, rgba(232, 76, 255, 0.08), transparent 50%);
}

.thread-empty {
  margin: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px;
  max-width: 420px;
}

.thread-empty h2 {
  color: var(--accent);
  font-size: 28px;
  text-shadow: 0 0 16px var(--glow);
}

.thread-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.thread-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(16, 10, 24, 0.7);
  backdrop-filter: blur(8px);
}

.thread-title {
  font-size: 18px;
}

.thread-sub {
  font-size: 12px;
}

.thread-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bubble {
  max-width: min(72%, 640px);
  padding: 10px 14px;
  border-radius: 18px;
  line-height: 1.45;
  font-size: 14px;
  position: relative;
  word-break: break-word;
}

.bubble.in {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.07);
  border-bottom-left-radius: 6px;
}

.bubble.out {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.55), rgba(232, 76, 255, 0.42));
  box-shadow: 0 0 16px rgba(232, 76, 255, 0.18);
  border-bottom-right-radius: 6px;
}

.bubble__media {
  font-size: 12px;
  color: #e9d5ff;
  margin-bottom: 4px;
  opacity: 0.85;
}

.bubble__time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 4px;
  text-align: right;
}

.day-sep {
  align-self: center;
  font-size: 12px;
  color: var(--muted);
  padding: 6px 10px;
  margin: 6px 0;
}

.composer {
  display: flex;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(16, 10, 24, 0.85);
  align-items: flex-end;
}

.composer textarea {
  min-height: 44px;
  max-height: 140px;
  resize: none;
  border-radius: 16px;
}

.composer .btn {
  height: 44px;
  flex-shrink: 0;
}

/* ========== MODALS / TOAST ========== */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 4, 14, 0.72);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  background: rgba(20, 12, 30, 0.96);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 0 40px var(--glow);
}

.modal-card--wide {
  width: min(720px, 100%);
}

.modal-title {
  margin-bottom: 8px;
}

.modal-message {
  color: #d4c4e8;
  margin-bottom: 18px;
  line-height: 1.5;
  white-space: pre-line;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-root.is-alert #modal-cancel {
  display: none;
}

.modal-root.is-danger .modal-card {
  box-shadow: 0 0 40px rgba(255, 77, 184, 0.45);
}

.modal-root.is-danger #modal-ok {
  background: rgba(255, 77, 184, 0.22);
  color: #fff;
}

.modal-root.is-danger #modal-ok:hover {
  background: var(--accent-2);
  box-shadow: 0 0 16px var(--accent-2);
}

.upload-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.upload-mode-card {
  text-align: left;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 14px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.upload-mode-card:hover {
  background: rgba(232, 76, 255, 0.16);
  box-shadow: 0 0 16px var(--glow);
}

.upload-mode-card strong {
  color: var(--accent);
  font-size: 16px;
}

.upload-mode-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.acc-detail-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.acc-detail-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  font-size: 14px;
  color: #d4c4e8;
}

.acc-detail-body b {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
  margin-bottom: 2px;
}

.process-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 70;
}

.process-toast__inner {
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(20, 12, 30, 0.95);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 0 24px var(--glow);
  min-width: 240px;
}

.process-toast__spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.process-toast__title {
  font-size: 13px;
  color: var(--accent);
}

.process-toast__text {
  font-size: 12px;
  color: var(--muted);
}

.toast {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(232, 76, 255, 0.12);
  color: #f3e8ff;
}

@media (max-width: 900px) {
  .dash-params-row--4,
  .dash-params-row--5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .inbox-list {
    width: 100%;
    min-width: 0;
  }
  .page--inbox {
    flex-direction: column;
    height: auto;
    min-height: calc(100vh - 80px);
  }
  .inbox-thread {
    min-height: 50vh;
  }
  .header {
    padding: 0 14px;
    height: 70px;
  }
  .content {
    padding-top: 70px;
  }
  .page--inbox {
    height: calc(100vh - 70px);
  }
  .upload-mode-grid,
  .acc-detail-body {
    grid-template-columns: 1fr;
  }
}

.field-hint {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

input:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  color: #e9d5ff;
}

.run-log {
  max-height: 240px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.run-log .log-ok { color: var(--ok); }
.run-log .log-err { color: var(--danger); }
.run-log .log-warn { color: var(--warn); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .header__left p { display: none; }
  .page-title { font-size: 26px; }
}
