:root {
  --ink: #07141f;
  --ink-2: #0d2233;
  --fog: #d7e6ef;
  --fog-dim: rgba(215, 230, 239, 0.62);
  --sea: #2f8f9d;
  --sea-deep: #1b6b78;
  --sand: #e8b86d;
  --sand-hot: #f0c985;
  --danger: #d96b5c;
  --ok: #5cb89a;
  --line: rgba(215, 230, 239, 0.12);
  --panel: rgba(13, 34, 51, 0.85);
  --font-display: "Syne", sans-serif;
  --font-body: "Figtree", sans-serif;
}

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

body.admin {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--fog);
  background:
    radial-gradient(ellipse 70% 45% at 80% 0%, rgba(47, 143, 157, 0.18), transparent 55%),
    radial-gradient(ellipse 45% 35% at 10% 90%, rgba(232, 184, 109, 0.08), transparent 50%),
    linear-gradient(160deg, #07141f 0%, #0a1c2b 50%, #0d2233 100%);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--sand);
  text-decoration: none;
}

a:hover {
  color: var(--sand-hot);
  text-decoration: underline;
}

.admin-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
}

.admin-top {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-size: 0.92rem;
}

.admin-nav a {
  color: var(--fog-dim);
  text-decoration: none;
  font-weight: 600;
}

.admin-nav a:hover,
.admin-nav a.active {
  color: var(--fog);
  text-decoration: none;
}

.admin-nav a.active {
  box-shadow: inset 0 -2px 0 var(--sand);
}

.flash {
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.92rem;
  border: 1px solid var(--line);
}

.flash.ok {
  background: rgba(92, 184, 154, 0.12);
  color: var(--ok);
}

.flash {
  transition: opacity 0.4s ease;
}

.flash.is-fading {
  opacity: 0;
}

.flash[hidden] {
  display: none !important;
}

.scan-size {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

.scan-size select,
.scan-size input {
  background: var(--panel-2, rgba(255, 255, 255, 0.04));
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.4rem 0.6rem;
  font: inherit;
}

.scan-size input {
  width: 7rem;
}

.join-all-toggle {
  display: inline-flex;
  align-items: center;
  position: relative;
  gap: 0.55rem;
  font-size: 0.86rem;
  color: var(--fog-dim);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.join-all-toggle input,
.inline-form .join-all-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  min-width: 0;
  padding: 0;
  border: 0;
}

.join-switch {
  position: relative;
  width: 2.1rem;
  height: 1.2rem;
  flex: none;
  border-radius: 999px;
  background: rgba(215, 230, 239, 0.14);
  border: 1px solid var(--line);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.join-switch::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0.15rem;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--fog);
  transform: translateY(-50%);
  transition: left 0.15s ease;
}

.join-all-toggle input:checked + .join-switch {
  background: var(--sea);
  border-color: var(--sea);
}

.join-all-toggle input:checked + .join-switch::after {
  left: calc(100% - 1rem);
}

.join-all-toggle input:focus-visible + .join-switch {
  box-shadow: 0 0 0 3px rgba(47, 143, 157, 0.3);
}

.join-all-toggle input:checked ~ .join-switch-text {
  color: var(--fog);
}

.join-note {
  margin: 0 0 0.75rem;
}

.join-progress {
  margin-bottom: 1.25rem;
}

.join-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.join-results {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  font-size: 0.86rem;
  max-height: 14rem;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.join-results li {
  padding: 0.35rem 0.7rem;
  border-bottom: 1px solid var(--line);
}

.join-results li:last-child {
  border-bottom: 0;
}

.join-results .join-joined span { color: var(--ok); }
.join-results .join-failed span { color: var(--danger); }
.join-results .join-already span,
.join-results .join-pending span { opacity: 0.7; }

.pool-join {
  margin: 1rem 0;
}

.pool-join h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.groups-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 0.75rem 0;
}

.groups-toolbar input[type="search"] {
  min-width: 16rem;
  flex: 1 1 16rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  background: rgba(7, 20, 31, 0.65);
  color: var(--fog);
}

.groups-toolbar input[type="search"]::placeholder {
  color: var(--fog-dim);
}

.groups-toolbar input[type="search"]:focus {
  outline: none;
  border-color: rgba(47, 143, 157, 0.55);
}

.groups-toolbar .filter-select-wrap select {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.groups-toolbar .btn-danger {
  margin-left: auto;
}

.groups-handle {
  font-size: 0.85rem;
}

.groups-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.groups-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.1rem 0.2rem 0.1rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.groups-chip-x {
  border: 0;
  background: none;
  color: inherit;
  opacity: 0.5;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0 0.3rem;
}

.groups-chip-x:hover {
  opacity: 1;
  color: var(--danger);
}

.flash.bad {
  background: rgba(217, 107, 92, 0.12);
  color: var(--danger);
}

.status-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.status-row .label {
  display: block;
  color: var(--fog-dim);
  font-size: 0.78rem;
  margin-bottom: 0.2rem;
}

.action-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.inline-form input,
.inline-form select,
.settings-form input,
.filters select,
.login-card input[type="password"],
.login-card input[type="email"],
.login-card input[name="name"] {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  background: rgba(7, 20, 31, 0.65);
  color: var(--fog);
  min-width: 12rem;
}

.inline-form input::placeholder,
.settings-form input::placeholder,
.login-card input::placeholder {
  color: var(--fog-dim);
}

.inline-form input:focus,
.inline-form select:focus,
.settings-form input:focus,
.filters select:focus,
.login-card input:focus {
  outline: none;
  border-color: rgba(47, 143, 157, 0.55);
}

.filters select {
  min-width: auto;
}

.groups-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin: 0.25rem 0 1rem;
}

.groups-field {
  display: grid;
  gap: 0.35rem;
  min-width: min(100%, 16rem);
}

.groups-field-grow {
  flex: 1 1 18rem;
  min-width: min(100%, 18rem);
}

.groups-field span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fog-dim);
}

.groups-field select,
.groups-field input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  font: inherit;
  background: rgba(7, 20, 31, 0.65);
  color: var(--fog);
  width: 100%;
  min-width: 0;
}

.groups-field select:focus,
.groups-field input:focus {
  outline: none;
  border-color: rgba(47, 143, 157, 0.55);
}

.groups-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.groups-result-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 20, 31, 0.35);
}

.groups-result-bar strong {
  margin-left: 0.35rem;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.groups-title-cell {
  font-weight: 600;
  color: var(--fog);
}

.groups-empty {
  padding: 2rem 1rem !important;
  text-align: center;
}

.groups-help {
  padding-top: 0.85rem;
}

.groups-help summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fog-dim);
  list-style: none;
}

.groups-help summary::-webkit-details-marker {
  display: none;
}

.groups-help[open] summary {
  color: var(--fog);
  margin-bottom: 0.75rem;
}

.settings-form {
  display: grid;
  gap: 1.25rem;
}

.settings-form fieldset {
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 0;
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
  background: rgba(7, 20, 31, 0.25);
}

.settings-form legend {
  font-family: var(--font-display);
  font-weight: 700;
  padding: 0 0.35rem;
  color: var(--fog);
}

.settings-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--fog-dim);
  font-weight: 600;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.admin-brand {
  font-family: var(--font-display);
  font-weight: 760;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  color: var(--fog);
  text-decoration: none;
}

.admin-brand:hover {
  text-decoration: none;
  color: var(--fog);
}

.admin-brand span {
  color: var(--sand);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, filter 160ms ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-sea {
  background: var(--sea);
  color: #07141f;
}

.btn-sea:hover {
  background: #3aa0ae;
  color: #07141f;
}

.btn-sand {
  background: var(--sand);
  color: #07141f;
}

.btn-sand:hover {
  background: var(--sand-hot);
  color: #07141f;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--fog);
  box-shadow: inset 0 0 0 1px var(--line);
}

.btn-ghost:hover {
  background: rgba(215, 230, 239, 0.06);
  color: var(--fog);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 800px) {
  .stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  backdrop-filter: blur(8px);
}

.stat .label {
  display: block;
  color: var(--fog-dim);
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
}

.stat .value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--fog);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1.1rem 1.15rem;
  margin-bottom: 1.25rem;
  backdrop-filter: blur(8px);
}

.panel h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--fog);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  text-align: left;
  padding: 0.65rem 0.45rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--fog-dim);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td a {
  color: var(--sand);
}

.pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(47, 143, 157, 0.18);
  color: #8fd4de;
}

.pill.complaint { background: rgba(232, 184, 109, 0.18); color: var(--sand); }
.pill.scam { background: rgba(217, 107, 92, 0.18); color: #f0a097; }
.pill.support { background: rgba(47, 143, 157, 0.18); color: #8fd4de; }
.pill.investor { background: rgba(120, 160, 90, 0.2); color: #b7d48a; }
.pill.user { background: rgba(110, 130, 200, 0.2); color: #b4c0ef; }
.pill.status-open,
.pill.status-dm_open,
.pill.status-ready { background: rgba(92, 184, 154, 0.16); color: var(--ok); }
.pill.status-awaiting_start,
.pill.status-logged_out,
.pill.status-code_sent { background: rgba(232, 184, 109, 0.16); color: var(--sand); }
.pill.status-escalated,
.pill.status-need_2fa,
.pill.status-error { background: rgba(217, 107, 92, 0.16); color: #f0a097; }
.pill.status-closed { background: rgba(215, 230, 239, 0.08); color: var(--fog-dim); }

.step-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fog-dim);
  margin-bottom: 0.45rem;
}

.twofa-box {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: rgba(7, 20, 31, 0.35);
}

.twofa-box-active {
  border-color: rgba(232, 184, 109, 0.45);
  background: rgba(232, 184, 109, 0.08);
}

.panel-tight {
  padding: 0.9rem 1rem;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  justify-content: space-between;
}

.panel-head h2 {
  margin: 0 0 0.2rem;
}

.muted.tight {
  margin: 0;
  font-size: 0.85rem;
}

.add-account-form input {
  min-width: 7.5rem;
}

.accounts-mast {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) auto;
  gap: 1.25rem 2rem;
  align-items: end;
  margin: 0.25rem 0 1.35rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.accounts-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sand);
}

.accounts-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.65rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.95;
  color: var(--fog);
}

.accounts-lede {
  margin: 0.65rem 0 0;
  max-width: 34rem;
  color: var(--fog-dim);
  font-size: 0.95rem;
  line-height: 1.45;
}

.accounts-stats {
  display: flex;
  gap: 1.35rem;
  margin: 0;
}

.accounts-stats > div {
  min-width: 3.5rem;
}

.accounts-stats dt {
  margin: 0 0 0.2rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fog-dim);
}

.accounts-stats dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--fog);
  line-height: 1;
}

.accounts-compose {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr);
  gap: 0.85rem 1.25rem;
  align-items: end;
  margin-bottom: 0.85rem;
  padding: 1rem 0 1.1rem;
  border-bottom: 1px solid var(--line);
}

.accounts-compose-label strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.accounts-compose-label span {
  display: block;
  margin-top: 0.25rem;
  color: var(--fog-dim);
  font-size: 0.82rem;
  line-height: 1.35;
}

.accounts-compose-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: end;
}

.accounts-field {
  display: grid;
  gap: 0.28rem;
  min-width: 8rem;
}

.accounts-field-grow {
  flex: 1 1 12rem;
  min-width: 11rem;
}

.accounts-field span {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fog-dim);
}

.accounts-field input {
  width: 100%;
  margin: 0;
  border: 1px solid rgba(215, 230, 239, 0.18);
  border-radius: 10px;
  background: rgba(7, 20, 31, 0.55);
  color: var(--fog);
  padding: 0.62rem 0.75rem;
  font: inherit;
}

.accounts-field input:focus {
  outline: none;
  border-color: rgba(47, 143, 157, 0.65);
  box-shadow: 0 0 0 3px rgba(47, 143, 157, 0.18);
}

.accounts-compose-go {
  align-self: end;
  white-space: nowrap;
}

.accounts-adsrail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.15rem;
  padding: 0.7rem 0;
}

.accounts-adsrail-copy strong {
  display: block;
  font-size: 0.88rem;
}

.accounts-adsrail-copy span {
  display: block;
  margin-top: 0.12rem;
  color: var(--fog-dim);
  font-size: 0.8rem;
}

.accounts-adsrail.is-offline .accounts-adsrail-copy span {
  color: var(--sand);
}

.accounts-empty {
  margin: 1.5rem 0 0;
  color: var(--fog-dim);
  font-size: 0.95rem;
}

@media (max-width: 820px) {
  .accounts-mast,
  .accounts-compose {
    grid-template-columns: 1fr;
  }

  .accounts-stats {
    gap: 1rem;
  }
}

.account-list {
  display: grid;
  gap: 0.65rem;
}

.account-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.7rem 0.85rem;
  backdrop-filter: blur(8px);
}

.account-card.is-ready {
  border-color: rgba(92, 184, 154, 0.28);
}

.account-card.needs-2fa {
  border-color: rgba(232, 184, 109, 0.4);
}

.account-main {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto auto;
  gap: 0.65rem 1rem;
  align-items: center;
}

@media (max-width: 820px) {
  .account-main {
    grid-template-columns: 1fr;
  }
}

.account-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.account-phone {
  display: block;
  color: var(--fog-dim);
  font-size: 0.82rem;
  margin-top: 0.12rem;
}

.account-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.meta-chip {
  font-size: 0.75rem;
  color: var(--fog-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
}

.meta-chip.adspower-chip {
  color: var(--sand);
  border-color: rgba(232, 184, 109, 0.35);
}

.meta-chip.muted-chip {
  opacity: 0.7;
}

.ads-bind {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.ads-bind-face {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.ads-bind-mark {
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(232, 184, 109, 0.35), rgba(47, 143, 157, 0.25)),
    rgba(7, 20, 31, 0.6);
  border: 1px solid rgba(232, 184, 109, 0.28);
  position: relative;
}

.ads-bind-mark::after {
  content: "";
  position: absolute;
  inset: 0.42rem;
  border: 1.5px solid var(--sand);
  border-radius: 3px;
  opacity: 0.85;
}

.ads-bind.is-linked .ads-bind-mark {
  border-color: rgba(92, 184, 154, 0.4);
  background:
    linear-gradient(145deg, rgba(92, 184, 154, 0.28), rgba(47, 143, 157, 0.2)),
    rgba(7, 20, 31, 0.6);
}

.ads-bind.is-linked .ads-bind-mark::after {
  border-color: var(--ok);
}

.ads-bind-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.ads-bind-copy strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ads-bind-copy span {
  display: block;
  margin-top: 0.08rem;
  font-size: 0.78rem;
  color: var(--fog-dim);
}

.ads-bind-toggle {
  flex: 0 0 auto;
}

.ads-bind.is-open .ads-bind-toggle {
  color: var(--sand);
}

.ads-bind-panel {
  margin-top: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 20, 31, 0.55);
  overflow: hidden;
}

.ads-bind-search {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--line);
}

.ads-bind-search input {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  font: inherit;
  font-size: 0.86rem;
  background: rgba(13, 34, 51, 0.75);
  color: var(--fog);
}

.ads-bind-search input:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(47, 143, 157, 0.45);
}

.ads-bind-list {
  max-height: 11.5rem;
  overflow: auto;
  padding: 0.3rem;
  display: grid;
  gap: 0.15rem;
}

.ads-bind-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  background: transparent;
  color: var(--fog);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ads-bind-option:hover,
.ads-bind-option:focus-visible {
  outline: none;
  background: rgba(47, 143, 157, 0.16);
}

.ads-bind-option.is-current {
  background: rgba(92, 184, 154, 0.12);
  box-shadow: inset 2px 0 0 var(--ok);
}

.ads-bind-option-main {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  min-width: 0;
}

.ads-bind-option-name {
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ads-bind-option-no {
  font-size: 0.78rem;
  color: var(--fog-dim);
  flex: 0 0 auto;
}

.ads-bind-option-id {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
}

.ads-bind-option-id code,
code.ads-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  color: var(--fog-dim);
  background: transparent;
  padding: 0;
  word-break: break-all;
}

.ads-bind-option-group {
  flex: 0 0 auto;
  font-size: 0.72rem;
  color: var(--fog-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
}

.ads-bind-empty {
  margin: 0.55rem;
  font-size: 0.84rem;
  color: var(--fog-dim);
}

.ads-bind-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.25rem;
  padding: 0.35rem 0.45rem 0.45rem;
  border-top: 1px solid var(--line);
}

.account-ops {
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
}

.account-note {
  margin-top: 0.45rem;
  font-size: 0.82rem;
  color: var(--fog-dim);
}

.account-note.is-error {
  color: var(--danger);
}

.account-login {
  margin-top: 0.45rem;
  border-top: 1px solid var(--line);
  padding-top: 0.35rem;
}

.account-login summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fog-dim);
  user-select: none;
}

.account-login summary::-webkit-details-marker {
  display: none;
}

.account-login[open] summary {
  margin-bottom: 0.45rem;
  color: var(--sand);
}

.login-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.toolbar-field {
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
}

.toolbar-field input {
  min-width: 0;
  width: 7.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  font: inherit;
  font-size: 0.85rem;
  background: rgba(7, 20, 31, 0.65);
  color: var(--fog);
}

.twofa-field input {
  width: 8.5rem;
}

.setup-steps {
  margin: 0.5rem 0 1rem;
  padding-left: 1.2rem;
  color: var(--fog-dim);
  line-height: 1.55;
}

.setup-steps li {
  margin-bottom: 0.35rem;
}

.setup-steps strong {
  color: var(--fog);
}

.muted {
  color: var(--fog-dim);
}

.clip {
  max-width: 28rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 70% 55% at 75% 20%, rgba(47, 143, 157, 0.28), transparent 60%),
    radial-gradient(ellipse 50% 40% at 15% 80%, rgba(232, 184, 109, 0.12), transparent 55%),
    linear-gradient(160deg, #07141f 0%, #0a1c2b 45%, #0d2233 100%);
}

.login-card {
  width: min(100%, 380px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.5rem;
  backdrop-filter: blur(10px);
}

.login-card h1 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  color: var(--fog);
}

.login-card p {
  margin: 0 0 1.2rem;
  color: var(--fog-dim);
}

.login-card form {
  display: grid;
  gap: 0.75rem;
}

.error {
  color: var(--danger);
  font-size: 0.9rem;
  margin: 0;
}

.case-meta {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
  color: var(--fog-dim);
  font-size: 0.92rem;
}

.case-meta strong {
  color: var(--fog);
  font-weight: 600;
}

.thread {
  display: grid;
  gap: 0.75rem;
}

.bubble {
  border-radius: 14px;
  padding: 0.8rem 0.95rem;
  max-width: 42rem;
  white-space: pre-wrap;
  line-height: 1.45;
  border: 1px solid var(--line);
}

.bubble.user {
  background: rgba(47, 143, 157, 0.12);
  justify-self: start;
}

.bubble.assistant {
  background: rgba(232, 184, 109, 0.1);
  justify-self: stretch;
}

.bubble .who {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: var(--fog-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.source-box {
  background: rgba(7, 20, 31, 0.45);
  border-left: 3px solid var(--sea);
  padding: 0.85rem 1rem;
  border-radius: 0 12px 12px 0;
  white-space: pre-wrap;
  margin: 0.5rem 0 1rem;
  color: var(--fog);
}

code {
  color: var(--sand);
  font-size: 0.88em;
}

.activity-feed {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.activity-panel .panel-head {
  margin-bottom: 0.55rem;
}

.activity-head {
  align-items: flex-end;
}

.activity-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 20, 31, 0.4);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  align-items: center;
  margin: 0;
}

.filter-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fog-dim);
}

.seg {
  display: inline-flex;
  padding: 0.18rem;
  border-radius: 10px;
  background: rgba(13, 34, 51, 0.85);
  border: 1px solid var(--line);
  gap: 0.12rem;
}

.seg-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--fog-dim);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.38rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.seg-item:hover {
  color: var(--fog);
  text-decoration: none;
  background: rgba(215, 230, 239, 0.06);
}

.seg-item.is-active {
  color: var(--ink);
  background: linear-gradient(180deg, #8fd4de 0%, var(--sea) 100%);
}

.filter-select-wrap {
  position: relative;
  min-width: 10.5rem;
}

.filter-select-wrap select {
  width: 100%;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.42rem 2rem 0.42rem 0.7rem;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  background: rgba(13, 34, 51, 0.85);
  color: var(--fog);
  cursor: pointer;
}

.filter-select-wrap::after {
  content: "";
  position: absolute;
  right: 0.75rem;
  top: 50%;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1.5px solid var(--fog-dim);
  border-bottom: 1.5px solid var(--fog-dim);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.filter-select-wrap select:focus {
  outline: none;
  border-color: rgba(47, 143, 157, 0.55);
}

.activity-filters {
  margin: 0;
}

.activity-table-wrap {
  margin-top: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
  max-height: min(70vh, 920px);
}

.activity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  min-width: 1100px;
}

.activity-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fog-dim);
  background: #0b1c2a;
  border-bottom: 1px solid var(--line);
  padding: 0.65rem 0.75rem;
  white-space: nowrap;
}

.activity-table tbody td {
  vertical-align: top;
  padding: 0.75rem 0.8rem;
  border-bottom: 1px solid rgba(215, 230, 239, 0.08);
  color: var(--fog);
}

.activity-table tbody tr:hover td {
  background: rgba(47, 143, 157, 0.06);
}

.activity-table .row-watched td {
  opacity: 0.78;
}

.cell-primary {
  font-weight: 600;
  line-height: 1.35;
  color: var(--fog);
}

.cell-time {
  margin-top: 0.12rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--fog);
  font-variant-numeric: tabular-nums;
}

.cell-secondary {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--fog-dim);
  line-height: 1.35;
}

.cell-stack {
  display: block;
}

.cell-secondary code {
  display: inline-block;
  font-size: 0.74rem;
  color: var(--sand);
}

.cell-full {
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: 0.86rem;
  max-width: 22rem;
}

.cell-clip {
  display: block;
  white-space: pre-wrap;
  line-height: 1.45;
  max-width: 22rem;
}

.col-msg .cell-full,
.col-dm .cell-full {
  max-width: 22rem;
}

.dm-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin-bottom: 0.35rem;
}

.col-dm-status {
  width: 6.5rem;
  vertical-align: top;
}

.dm-send-form {
  margin-top: 0.55rem;
}

.dm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
  align-items: center;
}

.dm-actions .dm-send-form {
  margin-top: 0;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.account-link {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}
.account-link:hover {
  color: var(--sea, #0d6e6e);
  text-decoration: underline;
}
.row-clickable {
  cursor: pointer;
}
.row-clickable:hover td {
  background: color-mix(in srgb, var(--sea, #0d6e6e) 6%, transparent);
}
.scan-form {
  max-width: 40rem;
}
.scan-form textarea {
  width: 100%;
  min-height: 4rem;
  font-family: inherit;
}
.scan-keywords-details {
  margin: 0.75rem 0 0.25rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid color-mix(in srgb, var(--ink, #1a1a1a) 12%, transparent);
  border-radius: 8px;
}
.scan-keywords-details summary {
  cursor: pointer;
  user-select: none;
}
.scan-keywords-details[open] summary {
  margin-bottom: 0.5rem;
}
.scan-keywords-details .tight-label {
  display: block;
  margin: 0;
}
.scan-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 0.85rem;
}
.scan-form.is-scanning fieldset {
  opacity: 0.55;
  pointer-events: none;
}
.scan-progress {
  margin-top: 1rem;
  max-width: 28rem;
}
.scan-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
  font-size: 0.88rem;
}
.scan-progress-meta #scan-progress-label {
  color: var(--fog, #c5cdd8);
}
.scan-progress-meta #scan-progress-pct {
  font-variant-numeric: tabular-nums;
  color: var(--fog-dim, #8a93a3);
}
.scan-progress-track {
  height: 0.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink, #1a1a1a) 14%, transparent);
  overflow: hidden;
}
.scan-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--sea, #0d6e6e) 70%, #1a9a9a),
    var(--sea, #0d6e6e)
  );
  transition: width 0.35s ease;
}
.scan-progress.is-indeterminate .scan-progress-fill {
  width: 35% !important;
  animation: scan-bar-slide 1.4s ease-in-out infinite;
}
@keyframes scan-bar-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
.scan-progress-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.45rem;
}
.scan-progress-detail {
  margin: 0;
  font-size: 0.8rem;
  flex: 1 1 auto;
}
.group-scan-stop {
  margin-top: 0.4rem;
}
.group-scan-progress.is-cancelled .group-scan-progress-fill {
  background: var(--fog-dim, #8a93a3);
}
.scan-progress[hidden] {
  display: none !important;
}

.groups-actions {
  min-width: 12rem;
  vertical-align: top;
}
.groups-actions-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.group-scan-progress {
  margin-top: 0.55rem;
  width: 7.5rem;
  max-width: 7.5rem;
}
.group-scan-progress[hidden] {
  display: none !important;
}
.group-scan-progress-meta {
  font-size: 0.72rem;
  color: var(--fog-dim, #8a93a3);
  margin-bottom: 0.28rem;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
.group-scan-progress-track {
  height: 0.3rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink, #1a1a1a) 16%, transparent);
  overflow: hidden;
}
.group-scan-progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--sea, #0d6e6e);
  transition: width 0.35s ease;
}
.group-scan-progress.is-done .group-scan-progress-fill {
  background: #1a7f4b;
}
.group-scan-progress.is-error .group-scan-progress-fill {
  background: #b42318;
}

.workspace-scan-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
}
.workspace-scan-tools .tight-label {
  margin: 0;
  font-size: 0.8rem;
  color: var(--fog-dim, #8a93a3);
}
.workspace-scan-tools input {
  width: 6.5rem;
  margin-top: 0.25rem;
}

.scan-tray {
  display: none !important;
}

.pill.dm-sent {
  background: color-mix(in srgb, #1a7f4b 18%, transparent);
  color: #14663c;
}

.pill.dm-failed {
  background: color-mix(in srgb, #b42318 16%, transparent);
  color: #912018;
}

.pill.dm-pending {
  background: color-mix(in srgb, #b54708 14%, transparent);
  color: #93370d;
}

.dm-fail-text {
  color: var(--fog-dim);
  margin-top: 0.25rem;
  font-size: 0.75rem;
  line-height: 1.35;
}

.cell-empty {
  color: var(--fog-dim);
  font-size: 0.8rem;
}

.col-when {
  width: 7.5rem;
  white-space: normal;
}

.col-account {
  min-width: 7rem;
  max-width: 10rem;
}

.col-group {
  min-width: 11rem;
  max-width: 13.5rem;
}

.col-user {
  min-width: 8.5rem;
  max-width: 11rem;
}

.col-kind {
  width: 8.5rem;
  white-space: nowrap;
}

.kind-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.col-kind .pill {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
}

.kind-conf {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fog-dim);
  font-variant-numeric: tabular-nums;
  padding-left: 0.1rem;
}

.col-msg,
.col-reply,
.col-dm {
  min-width: 14rem;
}

.col-link {
  width: 3.5rem;
  text-align: right;
  font-weight: 700;
  white-space: nowrap;
}

.activity-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  background: rgba(7, 20, 31, 0.35);
}

.activity-card.is-acted {
  border-color: rgba(92, 184, 154, 0.28);
  background: rgba(92, 184, 154, 0.05);
}

.activity-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.activity-who {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  align-items: baseline;
  min-width: 0;
}

.activity-who strong {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.activity-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.activity-case-link {
  font-size: 0.78rem;
  font-weight: 700;
}

.activity-meta {
  display: grid;
  grid-template-columns: minmax(14rem, 1.6fr) repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.45rem 0.9rem;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  align-items: start;
}

.activity-group {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.45rem;
  min-width: 0;
}

.activity-group .meta-v {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.group-id {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--sand);
  background: rgba(7, 20, 31, 0.55);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.08rem 0.35rem;
}

.meta-k {
  color: var(--fog-dim);
  margin-right: 0.25rem;
}

.meta-v {
  color: var(--fog);
  font-weight: 600;
}

.activity-blocks {
  display: grid;
  gap: 0.55rem;
}

@media (min-width: 900px) {
  .activity-card.is-acted .activity-blocks {
    grid-template-columns: 1.2fr 1fr 1fr;
  }
}

.activity-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: rgba(13, 34, 51, 0.45);
  min-width: 0;
}

.activity-block.is-empty {
  opacity: 0.7;
}

.block-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fog-dim);
  margin-bottom: 0.3rem;
}

.activity-block p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.4;
  font-size: 0.88rem;
}

.activity-empty {
  padding: 1.25rem 0.25rem;
  font-size: 0.92rem;
}

.agent-run-banner {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-top: 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(47, 143, 157, 0.35);
  background: rgba(47, 143, 157, 0.1);
}

.agent-run-banner.is-live {
  border-color: rgba(92, 184, 154, 0.4);
  background: rgba(92, 184, 154, 0.1);
}

.agent-run-banner strong {
  display: block;
  margin-bottom: 0.15rem;
}

.agent-run-dot {
  flex: 0 0 auto;
  width: 0.65rem;
  height: 0.65rem;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: var(--sand);
  box-shadow: 0 0 0 0 rgba(232, 184, 109, 0.55);
  animation: agent-pulse 1.4s ease-out infinite;
}

.agent-run-banner.is-live .agent-run-dot {
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(92, 184, 154, 0.55);
}

@keyframes agent-pulse {
  0% { box-shadow: 0 0 0 0 rgba(232, 184, 109, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(232, 184, 109, 0); }
  100% { box-shadow: 0 0 0 0 rgba(232, 184, 109, 0); }
}

.flash.agent-pulse {
  position: relative;
}

.profile-panel {
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.profile-avatar {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ink);
  background: linear-gradient(145deg, var(--sand), var(--sea));
  flex: 0 0 auto;
}

.profile-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

.profile-stats {
  margin-bottom: 1.5rem;
}

.profile-form fieldset {
  margin-bottom: 1.25rem;
}

.btn-ghost.is-active {
  color: var(--fog);
  border-color: rgba(215, 230, 239, 0.28);
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.profile-chip:hover {
  text-decoration: none;
  transform: translateY(-1px);
  border-color: rgba(215, 230, 239, 0.28);
}

.profile-chip.is-active {
  border-color: rgba(232, 184, 109, 0.55);
  box-shadow: 0 0 0 3px rgba(232, 184, 109, 0.12);
}

.profile-chip-avatar {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  background: linear-gradient(145deg, var(--sand), var(--sea));
  line-height: 1;
  user-select: none;
}

.pool-meta-row {
  margin: 0.65rem 0 0.85rem;
}

.pool-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--fog-dim);
}

.pool-chip a {
  color: inherit;
}

.pool-chip-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #8a94a6;
  flex-shrink: 0;
}

.pool-chip.is-ok .pool-chip-dot {
  background: #1a7f4b;
}

.pool-chip.is-off .pool-chip-dot {
  background: #b54708;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.watch-actions-inner {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
  white-space: nowrap;
}

.watch-actions-inner form {
  margin: 0;
}

.watch-scan {
  margin-top: 0.4rem;
  min-width: 10rem;
}

.watch-scan .scan-progress-track {
  height: 6px;
}

.proxy-panel {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(7, 20, 31, 0.35);
}

.proxy-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.proxy-panel-head > div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.proxy-panel-head span {
  color: var(--fog-dim);
  font-size: 0.88rem;
}

.proxy-require {
  margin: 0;
}

.proxy-assign {
  margin-top: 0.85rem;
}

.proxy-assign summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--fog);
}

.proxy-assign-form {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.75rem;
}

.proxy-assign-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  font: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.84rem;
  background: rgba(7, 20, 31, 0.65);
  color: var(--fog);
  resize: vertical;
}

.proxy-assign-form textarea:focus {
  outline: none;
  border-color: rgba(47, 143, 157, 0.55);
}

.proxy-assign-opts {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.9rem;
}

.proxy-opt {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--fog-dim);
}

.proxy-assign-opts .btn {
  margin-left: auto;
}

.proxy-test-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

#proxy-test-track {
  margin-top: 0.6rem;
}

.proxy-line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.proxy-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--fog-dim);
  opacity: 0.6;
}

.proxy-line.is-ok .proxy-dot {
  background: var(--ok);
  opacity: 1;
}

.proxy-line.is-bad .proxy-dot {
  background: var(--danger);
  opacity: 1;
}

.proxy-line.is-none .proxy-dot {
  background: #d9a441;
  opacity: 1;
}

.proxy-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: 0.86rem;
}

.proxy-copy span {
  color: var(--fog-dim);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proxy-line.is-bad .proxy-copy span {
  color: var(--danger);
}

.proxy-actions {
  display: flex;
  gap: 0.35rem;
}

.proxy-edit {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.proxy-edit[hidden] {
  display: none;
}

.proxy-edit input {
  flex: 1 1 16rem;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font: inherit;
  font-size: 0.84rem;
  background: rgba(7, 20, 31, 0.65);
  color: var(--fog);
}

.proxy-edit input:focus {
  outline: none;
  border-color: rgba(47, 143, 157, 0.55);
}

.proxy-edit .filter-select-wrap {
  min-width: 7rem;
}

.groups-table .col-check {
  width: 3rem;
  text-align: center;
  vertical-align: middle;
  padding-left: 0.9rem;
  padding-right: 0.4rem;
}

input.check {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  border: 1px solid rgba(215, 230, 239, 0.28);
  border-radius: 6px;
  background: rgba(7, 20, 31, 0.65);
  cursor: pointer;
  vertical-align: middle;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

input.check::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  transform: scale(0);
  transition: transform 0.12s ease;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  background: var(--ink);
}

input.check:hover {
  border-color: rgba(47, 143, 157, 0.7);
}

input.check:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(47, 143, 157, 0.3);
}

input.check:checked {
  background: var(--sea);
  border-color: var(--sea);
}

input.check:checked::before {
  transform: scale(1);
}

input.check:indeterminate {
  background: var(--sea);
  border-color: var(--sea);
}

input.check:indeterminate::before {
  transform: scale(1);
  height: 0.14rem;
  clip-path: none;
  border-radius: 2px;
}

.pill-count {
  display: inline-block;
  min-width: 1.4rem;
  margin-left: 0.35rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: rgba(215, 230, 239, 0.12);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.btn-sea .pill-count {
  background: rgba(7, 20, 31, 0.3);
}

.drafts-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 1rem;
}

.drafts-stats > div {
  flex: 1 1 10rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 20, 31, 0.35);
}

.drafts-stats dt {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fog-dim);
}

.drafts-stats dd {
  margin: 0.2rem 0 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
}

.drafts-showing {
  margin: -0.4rem 0 0.75rem;
}

.settings-form select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 2.2rem 0.55rem 0.75rem;
  font: inherit;
  color: var(--fog);
  cursor: pointer;
  background-color: rgba(7, 20, 31, 0.65);
  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 d='M1 1.5l5 5 5-5' fill='none' stroke='%23d7e6ef' stroke-opacity='.62' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 0.7rem auto;
  transition: border-color 0.15s ease;
}

.settings-form select:hover {
  border-color: rgba(47, 143, 157, 0.4);
}

.settings-form select:focus {
  outline: none;
  border-color: rgba(47, 143, 157, 0.55);
  box-shadow: 0 0 0 3px rgba(47, 143, 157, 0.18);
}

.settings-form select option {
  background: var(--ink-2);
  color: var(--fog);
}

.login-card input:disabled {
  opacity: 0.6;
}

.login-hint {
  margin: 0 !important;
  font-size: 0.8rem;
  color: var(--fog-dim);
}

.viewer-banner {
  margin: 0 0 1rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid rgba(232, 184, 109, 0.35);
  border-radius: 10px;
  background: rgba(232, 184, 109, 0.08);
  color: var(--sand);
  font-size: 0.88rem;
}

.role-viewer main form[method="post"] button[type="submit"],
.role-viewer .panel form[method="post"] button,
.role-viewer .panel button.btn-sea,
.role-viewer .panel button.btn-sand,
.role-viewer .panel button.btn-danger,
.role-viewer .panel [data-proxy-edit],
.role-viewer .panel [data-proxy-test] {
  display: none !important;
}

.team-invite {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(7, 20, 31, 0.35);
}

.team-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1 1 14rem;
  font-size: 0.8rem;
  color: var(--fog-dim);
  font-weight: 600;
}

.team-field-role {
  flex: 0 1 10rem;
}

.team-field input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-weight: 400;
  background: rgba(7, 20, 31, 0.65);
  color: var(--fog);
}

.team-field input:focus {
  outline: none;
  border-color: rgba(47, 143, 157, 0.55);
}

.team-field .filter-select-wrap select {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.team-sub {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--fog);
}

.team-table {
  margin-bottom: 1.5rem;
}

.team-table td {
  vertical-align: middle;
}

.team-table .cell-sub {
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.team-table tr.is-off td {
  opacity: 0.55;
}

.team-table tr.is-new td {
  background: rgba(47, 143, 157, 0.08);
}

.team-actions {
  text-align: right;
  white-space: nowrap;
}

.team-actions form {
  display: inline-block;
  margin: 0 0 0 0.35rem;
}

.team-remove:hover {
  color: var(--danger);
  border-color: rgba(217, 107, 92, 0.5);
}

.team-role-form {
  margin: 0;
  max-width: 9.5rem;
}

.role-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--line);
}

.role-badge.role-owner {
  color: var(--sand);
  border-color: rgba(232, 184, 109, 0.45);
  background: rgba(232, 184, 109, 0.1);
}

.role-badge.role-manager {
  color: #8fd4de;
  border-color: rgba(47, 143, 157, 0.5);
  background: rgba(47, 143, 157, 0.12);
}

.role-badge.role-viewer {
  color: var(--fog-dim);
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.status-dot::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--fog-dim);
}

.status-dot.is-on::before {
  background: var(--ok);
}

.status-dot.is-off::before {
  background: var(--danger);
}

.invite-link {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  min-width: 18rem;
}

.invite-link input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  font: inherit;
  font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: rgba(7, 20, 31, 0.65);
  color: var(--fog);
}

.role-viewer .panel form.profile-form[method="post"] button {
  display: inline-flex !important;
}

.perm-form {
  margin: 0 0 1.75rem;
}

.perm-table {
  margin-bottom: 0.75rem;
}

.perm-table td {
  vertical-align: middle;
}

.perm-col {
  width: 7rem;
  text-align: center;
}

.perm-switch {
  display: inline-flex;
  position: relative;
  cursor: pointer;
}

.perm-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  min-width: 0;
  padding: 0;
  border: 0;
}

.perm-switch input:checked + .join-switch {
  background: var(--sea);
  border-color: var(--sea);
}

.perm-switch input:checked + .join-switch::after {
  left: calc(100% - 1rem);
}

.perm-switch input:focus-visible + .join-switch {
  box-shadow: 0 0 0 3px rgba(47, 143, 157, 0.3);
}

.perm-always {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sand);
  border: 1px solid rgba(232, 184, 109, 0.4);
  background: rgba(232, 184, 109, 0.08);
}

.perm-fixed td {
  opacity: 0.7;
}

.perm-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem;
}

.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;
}

.pill.dm-seen {
  color: #8fd4de;
  border-color: rgba(47, 143, 157, 0.55);
  background: rgba(47, 143, 157, 0.14);
}

.pill.dm-replied {
  color: var(--ink);
  border-color: var(--sand);
  background: var(--sand);
}

.dm-track-time {
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: var(--fog-dim);
  font-variant-numeric: tabular-nums;
}

.dm-reply-text {
  margin-top: 0.35rem;
  max-width: 14rem;
  font-size: 0.8rem;
  color: var(--fog);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.drafts-stats dd small {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--fog-dim);
  margin-left: 0.25rem;
}

.notif-bell {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  color: var(--fog-dim);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.notif-bell:hover,
.notif-bell.is-active {
  color: var(--fog);
  border-color: rgba(47, 143, 157, 0.55);
  text-decoration: none;
}

.notif-count {
  position: absolute;
  top: -0.3rem;
  right: -0.35rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--sand);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
}

.notif-count[hidden] {
  display: none;
}

.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.notif-item {
  display: grid;
  grid-template-columns: 2.2rem 1fr auto;
  align-items: start;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 20, 31, 0.3);
}

.notif-item.is-unread {
  border-color: rgba(47, 143, 157, 0.5);
  background: rgba(47, 143, 157, 0.08);
}

.notif-icon {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 700;
  color: #8fd4de;
  background: rgba(47, 143, 157, 0.16);
}

.notif-replied .notif-icon {
  color: var(--ink);
  background: var(--sand);
  font-size: 1rem;
}

.notif-copy {
  min-width: 0;
}

.notif-title {
  color: var(--fog);
  font-weight: 600;
}

.notif-body {
  margin-top: 0.2rem;
  font-size: 0.85rem;
  color: var(--fog-dim);
  overflow-wrap: anywhere;
}

.notif-time {
  font-size: 0.78rem;
  color: var(--fog-dim);
  white-space: nowrap;
}

.fu-engine {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.85rem;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 20, 31, 0.35);
}

.fu-engine-copy {
  flex: 1 1 22rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.fu-engine-copy span {
  font-size: 0.84rem;
  color: var(--fog-dim);
}

.fu-opt {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--fog-dim);
  font-weight: 600;
}

.fu-opt .filter-select-wrap {
  min-width: 9.5rem;
}

.fu-block {
  margin-top: 0.6rem;
  padding: 0.55rem 0.65rem;
  border-left: 2px solid rgba(47, 143, 157, 0.55);
  border-radius: 0 8px 8px 0;
  background: rgba(47, 143, 157, 0.06);
}

.fu-block.fu-blocked,
.fu-block.fu-gone {
  border-left-color: rgba(217, 107, 92, 0.7);
  background: rgba(217, 107, 92, 0.06);
}

.fu-block.fu-skipped {
  border-left-color: var(--line);
  background: transparent;
}

.fu-label {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fog-dim);
  margin-bottom: 0.3rem;
}

.fu-note {
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--fog-dim);
}

.fu-blocked .fu-note,
.fu-gone .fu-note {
  color: var(--danger);
}

.fu-now {
  margin-top: 0.5rem;
}

.notif-blocked .notif-icon {
  color: var(--danger);
  background: rgba(217, 107, 92, 0.16);
  font-size: 1rem;
}

.notif-followup .notif-icon {
  color: var(--sand);
  background: rgba(232, 184, 109, 0.14);
  font-size: 1rem;
}
