.profile-wrap {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 20px 18px 48px;
}

.profile-tabs {
  display: flex;
  gap: 8px;
  padding: 5px;
  margin: 0 auto 14px;
  background: #0b0b0b;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
}

.profile-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 11px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #aaa;
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}

.profile-tab:hover {
  color: #fff;
  background: rgba(255,255,255,.05);
}

.profile-tab.active {
  color: #fff;
  background: #1f1f1f;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

.profile-panel[hidden] {
  display: none !important;
}

.cardish {
  background: #0f0f0f;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  padding: 18px;
  margin: 14px 0;
}

.profile-hero {
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(10,132,255,.16), transparent 36%),
    #0f0f0f;
}

.profile-hero-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.profile-title-line {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.profile-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  object-fit: contain;
  image-rendering: auto;
}

.profile-icon[hidden] {
  display: none !important;
}

.profile-identity {
  min-width: 0;
  flex: 1;
}

#pName {
  margin: 0;
  font-size: clamp(21px, 3.6vw, 30px);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.profile-meta-actions {
  display: flex;
  align-items: center;
  margin-top: 10px;
}

.profile-location-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
  color: #ddd;
  font-size: 14px;
}

.profile-meta-value {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.profile-lightning-inline {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #eee;
}

.profile-dot {
  opacity: .45;
}

.profile-zap {
  color: #ffd65a;
}

.profile-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.profile-voice-status {
  display: inline-flex;
  align-items: center;
  min-height: 35px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.045);
  color: #aaa;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.profile-voice-on {
  border-color: rgba(52,199,89,.35);
  background: rgba(52,199,89,.10);
  color: #9be6ad;
}

.profile-voice-off {
  color: #888;
}

.profile-client-actions {
  justify-content: flex-end;
  margin-top: 0;
}

.profile-presence-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  margin-top: 10px;
}

.profile-presence-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
  color: #aaa;
  font-size: 13px;
}

.profile-presence-line strong {
  color: #eee;
  font-weight: 700;
}

.profile-detail {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
}

.profile-detail-label {
  display: block;
  margin-bottom: 5px;
  color: #888;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.profile-detail code,
.identity-details code {
  display: block;
  max-width: 100%;
  color: #eee;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.profile-gender-value {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #eee;
  font-size: 13px;
}

.profile-gender-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #393838;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}

.profile-gender-male { background: #4da3ff; }
.profile-gender-female { background: #ff2a8d; }
.profile-gender-trans_male,
.profile-gender-trans_female { background: #9e00ad; }
.profile-gender-other { background: #9e0404; }
.profile-gender-prefer_not_to_say { background: #8b5a2b; }
.profile-gender-not_set { background: #393838; }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.pill:hover {
  opacity: 1;
  background: rgba(255,255,255,.11);
}

.pill-primary {
  border-color: rgba(10,132,255,.65);
  background: rgba(10,132,255,.22);
}

.pill-primary:hover {
  background: rgba(10,132,255,.34);
}

.profile-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.profile-network-card {
  padding: 14px 16px 12px;
}

.profile-network-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-network-stat {
  background: rgba(255,255,255,.025);
}

.profile-network-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 9px;
}

.profile-stat {
  min-width: 0;
  padding: 14px 10px;
  text-align: center;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 14px;
  background: #101010;
}

.profile-stat strong {
  display: block;
  margin-bottom: 5px;
  font-size: 22px;
  line-height: 1;
}

.profile-stat > span {
  color: #aaa;
  font-size: 12px;
  white-space: nowrap;
}

.profile-zap-stats {
  margin: 0 0 14px;
}

.profile-stat-grid-zaps {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}

.profile-stat-zap strong {
  font-size: 20px;
}

.profile-stat-zap .sats-symbol {
  color: #f7931a;
  font-weight: 800;
  margin-right: 2px;
}

.profile-zap-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.profile-zap-footer .pill {
  min-width: 150px;
  justify-content: center;
  margin-left: auto;
}

.profile-stats-note {
  margin: 0 2px;
  color: #777;
  font-size: 11px;
  text-align: left;
}

.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.section-heading-row h2 {
  margin: 0;
  text-align: left;
  font-size: 20px;
}

.section-heading-row p {
  margin: 6px 0 0;
  color: #999;
  font-size: 13px;
  line-height: 1.4;
}

.heading-count {
  color: #999;
  font-size: .72em;
  font-weight: 700;
}

.profile-status {
  padding: 16px 0 4px;
  color: #999;
  font-size: 13px;
}

.guest-notes-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.guest-note-item {
  padding: 13px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 13px;
  background: rgba(255,255,255,.035);
}

.guest-note-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}

.guest-note-avatar,
.guest-note-avatar-fallback {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.14);
  background: #222;
}

.guest-note-avatar {
  object-fit: cover;
}

.guest-note-avatar-fallback {
  display: grid;
  place-items: center;
  color: #ddd;
  font-weight: 900;
}

.guest-note-author-block {
  min-width: 0;
  flex: 1;
}

.guest-note-author {
  display: inline-block;
  max-width: 100%;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.guest-note-author:hover {
  text-decoration: underline;
}

.guest-note-time {
  margin-top: 2px;
  color: #888;
  font-size: 12px;
}

.guest-note-body {
  color: #eee;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.guest-note-empty {
  padding: 20px 14px;
  text-align: center;
  color: #aaa;
  border: 1px dashed rgba(255,255,255,.14);
  border-radius: 13px;
}

.guest-note-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.instance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.instance-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
}

.instance-item span,
.identity-details span {
  display: block;
  margin-bottom: 5px;
  color: #858585;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.instance-item strong {
  display: block;
  color: #eee;
  font-size: 14px;
  overflow-wrap: anywhere;
}


.cron-health-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.cron-health-heading h3 {
  margin: 0;
  font-size: 17px;
}

.cron-health-heading p {
  margin: 5px 0 0;
  color: #8f8f8f;
  font-size: 12px;
  line-height: 1.45;
}

.cron-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.cron-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 13px;
  background: rgba(255,255,255,.03);
}

.cron-card.cron-good {
  border-color: rgba(50,205,90,.30);
  background: rgba(50,205,90,.055);
}

.cron-card.cron-warning {
  border-color: rgba(255,193,7,.30);
  background: rgba(255,193,7,.05);
}

.cron-card.cron-bad {
  border-color: rgba(255,75,75,.30);
  background: rgba(255,75,75,.05);
}

.cron-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.cron-card-head > strong {
  font-size: 14px;
  line-height: 1.3;
}

.cron-card p {
  min-height: 34px;
  margin: 8px 0;
  color: #999;
  font-size: 12px;
  line-height: 1.4;
}

.cron-last {
  color: #888;
  font-size: 12px;
}

.cron-last strong {
  color: #ccc;
  font-weight: 700;
}

.identity-details {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.health-pill {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.health-good {
  color: #8ff0a4;
  border-color: rgba(50,205,90,.4);
  background: rgba(50,205,90,.1);
}

.health-warning {
  color: #ffd166;
  border-color: rgba(255,193,7,.4);
  background: rgba(255,193,7,.1);
}

.health-bad {
  color: #ff8f8f;
  border-color: rgba(255,75,75,.4);
  background: rgba(255,75,75,.1);
}

.health-unknown {
  color: #aaa;
  background: rgba(255,255,255,.05);
}

.technical-heading {
  align-items: center;
}

.technical-details {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.technical-details[hidden] {
  display: none !important;
}

.kv {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 10px 14px;
}

.k {
  color: #999;
}

.v,
.v code {
  min-width: 0;
  overflow-wrap: anywhere;
}

.kv-meta {
  margin-left: 8px;
  color: #888;
  font-size: 13px;
}

.technical-subheading {
  margin-top: 18px;
  color: #bbb;
  font-size: 13px;
  font-weight: 800;
}

.kind-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 9px;
  margin-top: 9px;
}

.kind-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 11px;
  background: rgba(255,255,255,.035);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
}

.small {
  color: #999;
  font-size: 13px;
}

.technical-note {
  margin: 14px 0 0;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .profile-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-stat-grid-zaps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .instance-grid,
  .cron-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .profile-wrap {
    padding: 14px 10px 38px;
  }

  .profile-tab {
    padding: 10px 8px;
    font-size: 12.5px;
  }

  .cardish {
    padding: 14px;
    border-radius: 14px;
  }

  .profile-hero-main {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
  }

  .profile-icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }

  .profile-identity {
    width: auto;
    flex: 1 1 auto;
  }

  .profile-meta-actions {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 9px 12px;
  }

  .profile-hero-actions {
    width: auto;
    flex: 0 0 auto;
    justify-content: flex-end;
  }

  .profile-client-actions {
    justify-content: flex-end;
  }

  .profile-presence-actions {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .profile-presence-line {
    flex: 1 1 100%;
  }

  .profile-client-actions {
    width: 100%;
  }

  .guest-note-actions {
    justify-content: stretch;
  }

  .guest-note-actions .pill {
    flex: 1 1 100%;
  }

  .profile-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-stat-grid:not(.profile-stat-grid-zaps) .profile-stat:last-child {
    grid-column: 1 / -1;
  }

  .section-heading-row {
    flex-direction: column;
  }

  .guest-note-leave-top {
    width: 100%;
  }

  .health-pill {
    align-self: flex-start;
  }

  .technical-heading {
    align-items: stretch;
  }

  .technical-heading .pill {
    width: 100%;
  }

  .kv {
    grid-template-columns: 1fr;
    gap: 3px 0;
  }

  .kv .v {
    margin-bottom: 9px;
  }

  .kv-meta {
    display: block;
    margin: 3px 0 0;
  }
}
