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

.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.header-actions,
.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 74px;
}

.header-left {
  justify-content: flex-start;
}

.header-actions {
  justify-content: flex-end;
}

.icon-btn,
.text-btn,
.primary-btn,
.ghost-btn {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card-soft);
  padding: 8px 10px;
  cursor: pointer;
  transition: 0.2s ease;
}

.icon-btn:hover,
.text-btn:hover,
.primary-btn:hover,
.ghost-btn:hover {
  border-color: var(--accent);
}

.primary-btn {
  background: linear-gradient(120deg, var(--accent-soft), rgba(82, 120, 240, 0.22));
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.03);
}

.card {
  background: linear-gradient(180deg, rgba(31, 44, 67, 0.62), rgba(21, 30, 48, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 14px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stack {
  display: grid;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(132, 244, 161, 0.35);
  color: #d7ffe3;
  background: rgba(132, 244, 161, 0.09);
  font-size: 12px;
  font-weight: 600;
}

.badge.profile-badge-trigger {
  cursor: pointer;
}

.badge.alt {
  border-color: rgba(83, 216, 251, 0.35);
  color: #dff8ff;
  background: rgba(83, 216, 251, 0.11);
}

.profile-help-modal[hidden] {
  display: none;
}

.profile-help-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.profile-help-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 9, 16, 0.72);
  backdrop-filter: blur(4px);
}

.profile-help-dialog {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 24px;
  display: grid;
  gap: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.profile-help-text {
  color: #d8e3ff;
  line-height: 1.45;
  font-size: 14px;
}

.list-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(130deg, #3c4f73, #243352);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #e5ebff;
}

.avatar.large {
  width: 82px;
  height: 82px;
  font-size: 26px;
}

.meta-muted {
  color: var(--text-muted);
  font-size: 13px;
}

.unread {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #08212a;
  font-size: 12px;
  font-weight: 700;
  padding: 0 6px;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 8px;
  background: rgba(20, 28, 44, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  backdrop-filter: blur(8px);
}

.toolbar-btn {
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-muted);
  padding: 8px 4px;
  cursor: pointer;
  display: grid;
  justify-items: center;
  gap: 4px;
  font-size: 11px;
}

.toolbar-btn.active {
  background: rgba(83, 216, 251, 0.14);
  color: var(--text);
}

.page-label {
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
  font-size: 12px;
  color: #c5d2f4;
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-wrap {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 10px;
  min-height: calc(100dvh - 210px);
}

.messages-log {
  display: grid;
  gap: 8px;
  align-content: start;
}

.bubble {
  max-width: 76%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.35;
}

.bubble.in {
  justify-self: start;
  background: #1f2c46;
  border-top-left-radius: 6px;
}

.bubble.out {
  justify-self: end;
  background: #273f63;
  border-top-right-radius: 6px;
}

.chat-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.input {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  min-height: 40px;
  padding: 0 12px;
}

.network-board {
  position: relative;
  height: 290px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at center, rgba(83, 216, 251, 0.08), rgba(255, 255, 255, 0.01));
  overflow: hidden;
}

.network-svg {
  position: absolute;
  inset: 0;
}

.node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 74px;
  text-align: center;
}

.node-dot {
  width: 52px;
  height: 52px;
  margin: 0 auto 4px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: #2f4265;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.node.center .node-dot {
  width: 60px;
  height: 60px;
  background: linear-gradient(130deg, #3a5f8e, #3dc4df);
  color: #061119;
}

.node-label {
  font-size: 11px;
  color: #d6e2ff;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.02);
}

.tab-btn {
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 8px;
  color: var(--text-muted);
  cursor: pointer;
}

.tab-btn.active {
  background: rgba(83, 216, 251, 0.16);
  color: var(--text);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 20;
}

.modal-card {
  width: min(100%, 390px);
  background: #172238;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 14px;
}
