.linklounge-toggle {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 24;
  display: grid;
  grid-template-columns: auto auto;
  gap: 3px 14px;
  align-items: center;
  min-width: 220px;
  min-height: 52px;
  padding: 9px 14px;
  border: 1px solid rgba(85, 230, 255, 0.5);
  border-radius: 6px;
  background: rgba(7, 12, 15, 0.84);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.linklounge-toggle > span {
  grid-row: 1 / 3;
  color: var(--cyan);
  font-size: 1rem;
  font-weight: 950;
  text-transform: uppercase;
}

.linklounge-toggle b,
.linklounge-head-status b {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
  text-transform: uppercase;
}

.linklounge-toggle b i,
.linklounge-head-status b i,
.mobile-linklounge-toggle i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(100, 240, 141, 0.8);
}

.linklounge-toggle em {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 24px;
  height: 24px;
  padding: 4px;
  border: 2px solid #08090c;
  border-radius: 50%;
  background: var(--magenta);
  color: white;
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 950;
  text-align: center;
}

.linklounge-toggle:hover,
.linklounge-toggle[aria-expanded="true"] {
  border-color: var(--cyan);
  background: rgba(16, 35, 41, 0.92);
}

.mobile-linklounge-toggle {
  display: none;
}

.menu-linklounge-toggle {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 14px;
  padding: 8px 16px;
  border: 1px solid rgba(85, 230, 255, 0.66);
  border-radius: 5px;
  background: rgba(7, 18, 22, 0.9);
  color: var(--cyan);
  box-shadow: 0 0 20px rgba(85, 230, 255, 0.1);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 950;
  text-transform: uppercase;
}

.menu-linklounge-toggle:hover,
.menu-linklounge-toggle[aria-expanded="true"] {
  border-color: var(--cyan);
  background: rgba(15, 39, 46, 0.96);
}

.menu-linklounge-toggle small {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 0.64rem;
}

.menu-linklounge-toggle small i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(100, 240, 141, 0.8);
}

body.linklounge-open {
  overflow: hidden;
}

.linklounge-panel {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  background:
    linear-gradient(rgba(5, 8, 12, 0.94), rgba(5, 8, 12, 0.98)),
    radial-gradient(circle at 25% 20%, rgba(85, 230, 255, 0.16), transparent 32%),
    #06080b;
  color: var(--text);
}

.linklounge-designation-error {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 16px clamp(20px, 3vw, 50px);
  border-bottom: 2px solid rgba(255, 91, 83, 0.72);
  background: rgba(105, 14, 18, 0.96);
  color: #fff;
  font-size: clamp(1rem, 1.5vw, 1.3rem);
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
}

.linklounge-designation-error strong {
  color: #ffb4ae;
  font-size: 1.08em;
  text-transform: uppercase;
}

.linklounge-designation-error[hidden] {
  display: none !important;
}

.linklounge-panel button,
.linklounge-panel input {
  font: inherit;
}

.linklounge-head {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  min-height: 96px;
  padding: 16px clamp(20px, 2.5vw, 46px);
  border-bottom: 1px solid rgba(85, 230, 255, 0.28);
  background: rgba(7, 10, 14, 0.96);
}

.linklounge-head > div,
.linklounge-head-status {
  display: flex;
  gap: 14px;
  align-items: center;
}

.linklounge-head small,
.linklounge-room-head small {
  display: block;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.linklounge-head h2,
.linklounge-room-head h3,
.linklounge-people h3 {
  margin: 0;
  letter-spacing: 0;
}

.linklounge-head h2 {
  font-size: clamp(1.85rem, 3vw, 2.65rem);
  text-transform: uppercase;
}

.linklounge-signal {
  position: relative;
  display: block;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(85, 230, 255, 0.65);
  border-radius: 50%;
}

.linklounge-signal::after {
  content: "";
  position: absolute;
  inset: 25px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 16px var(--cyan);
}

.linklounge-signal i {
  position: absolute;
  top: 27px;
  left: 27px;
  width: 15px;
  height: 15px;
  border-bottom: 2px solid rgba(85, 230, 255, 0.78);
  border-left: 2px solid rgba(85, 230, 255, 0.78);
  transform-origin: 2px 2px;
}

.linklounge-signal i:nth-child(1) { transform: rotate(0deg); }
.linklounge-signal i:nth-child(2) { transform: rotate(120deg); }
.linklounge-signal i:nth-child(3) { transform: rotate(240deg); }

#linklounge-developer-status {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

#linklounge-developer-status.online {
  border-color: rgba(215, 177, 95, 0.66);
  color: var(--gold);
}

#linklounge-close {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  font-size: 1.8rem;
  line-height: 1;
}

.linklounge-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(460px, 1fr) minmax(230px, 300px);
  min-height: 0;
  width: 100%;
  margin: 0 auto;
  padding: 0 clamp(12px, 1.5vw, 28px);
  box-sizing: border-box;
}

.linklounge-rooms,
.linklounge-people {
  min-height: 0;
  padding: 30px 22px;
  background: rgba(9, 12, 16, 0.84);
}

.linklounge-rooms {
  border-right: 1px solid rgba(255, 255, 255, 0.11);
}

.linklounge-rooms button {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 78px;
  margin-bottom: 10px;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.linklounge-rooms button:hover,
.linklounge-rooms button.active {
  border-color: rgba(85, 230, 255, 0.58);
  background: rgba(85, 230, 255, 0.1);
}

.linklounge-rooms button span {
  font-size: 1.08rem;
  font-weight: 950;
}

.linklounge-rooms button small,
.linklounge-safety-note,
.linklounge-people > p {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.linklounge-safety-note {
  margin: 24px 5px 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.linklounge-safety-note p {
  margin: 0;
}

.linklounge-safety-note p + p {
  margin-top: 10px;
  color: rgba(255, 219, 107, 0.9);
}

.linklounge-conversation {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  background: rgba(4, 7, 10, 0.72);
}

.linklounge-room-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  padding: 16px 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.linklounge-room-head h3 {
  font-size: 1.5rem;
}

#linklounge-connection-status {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
}

#linklounge-connection-status.online { color: var(--green); }
#linklounge-connection-status.error { color: var(--red); }

.linklounge-messages {
  overflow-y: auto;
  min-height: 0;
  margin: 0;
  padding: 22px 26px 32px;
  list-style: none;
  overscroll-behavior: contain;
}

.linklounge-message {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 15px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  transition: opacity 10s linear;
}

.linklounge-message.expiring { opacity: 0.2; }

.linklounge-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(85, 230, 255, 0.5);
  border-radius: 50%;
  background: rgba(85, 230, 255, 0.1);
  color: var(--cyan);
  font-size: 0.86rem;
  font-weight: 950;
}

button.linklounge-avatar,
button.linklounge-player-name,
button.linklounge-person {
  cursor: pointer;
}

button.linklounge-avatar:hover,
button.linklounge-avatar:focus-visible {
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(85, 230, 255, 0.22);
}

.linklounge-message-body {
  min-width: 0;
}

.linklounge-message-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: baseline;
}

.linklounge-message-meta strong {
  font-size: 1rem;
}

.linklounge-player-name {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  font-weight: 950;
  text-align: left;
}

.linklounge-player-name:hover,
.linklounge-player-name:focus-visible { color: var(--cyan); }

.linklounge-message-meta time,
.linklounge-chant,
.linklounge-developer-badge {
  font-size: 0.76rem;
  font-weight: 850;
}

.linklounge-message-meta time { color: #777c83; }
.linklounge-chant.common { color: var(--text); }
.linklounge-chant.rare { color: var(--cyan); }
.linklounge-chant.legendary { color: var(--gold); }
.linklounge-developer-badge { color: var(--gold); text-transform: uppercase; }

.linklounge-message-body > p {
  overflow-wrap: anywhere;
  margin: 5px 0 0;
  color: #e7e2da;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1.05rem;
  line-height: 1.45;
  letter-spacing: 0;
}

.linklounge-message-actions {
  display: flex;
  gap: 4px;
  opacity: 0.28;
  transition: opacity 120ms ease;
}

.linklounge-message:hover .linklounge-message-actions,
.linklounge-message:focus-within .linklounge-message-actions {
  opacity: 1;
}

.linklounge-message-actions button {
  min-height: 28px;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.linklounge-message-actions button:hover { color: var(--text); border-color: var(--cyan); }
.linklounge-message-actions button.danger:hover { color: var(--red); border-color: var(--red); }

.linklounge-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(440px, 80%);
  margin: 0;
  color: #737980;
  font-size: 1rem;
  text-align: center;
  transform: translate(-50%, -50%);
}

.linklounge-form {
  padding: 16px 26px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(7, 10, 14, 0.96);
}

.linklounge-form > label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.linklounge-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
}

.linklounge-form input {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  outline: 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
  letter-spacing: 0;
}

.linklounge-form input:focus { border-color: var(--cyan); }
.linklounge-form input:disabled { opacity: 0.5; cursor: not-allowed; }

.linklounge-form button {
  border: 1px solid var(--cyan);
  border-radius: 5px;
  background: rgba(85, 230, 255, 0.14);
  color: var(--cyan);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 950;
  text-transform: uppercase;
}

.linklounge-form > p {
  display: flex;
  justify-content: space-between;
  min-height: 18px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

#linklounge-message-status.error { color: var(--red); }
#linklounge-message-status.success { color: var(--green); }

.linklounge-people {
  overflow-y: auto;
  border-left: 1px solid rgba(255, 255, 255, 0.11);
}

.linklounge-people h3 {
  margin-bottom: 16px;
  font-size: 1rem;
  text-transform: uppercase;
}

.linklounge-people ol {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.linklounge-person {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 8px 4px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.linklounge-person button {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  text-align: left;
}

.linklounge-person button:hover,
.linklounge-person button:focus-visible {
  border-color: rgba(85, 230, 255, 0.45);
  background: rgba(85, 230, 255, 0.08);
  color: var(--text);
}

.linklounge-person i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.linklounge-person.developer { color: var(--gold); }
.linklounge-people > p { margin-top: 24px; }

.linklounge-directory-open {
  width: 100%;
  min-height: 44px;
  margin-top: 18px;
  border: 1px solid rgba(215, 177, 95, 0.62);
  border-radius: 4px;
  background: rgba(215, 177, 95, 0.1);
  color: var(--gold);
  cursor: pointer;
  font-weight: 950;
  text-transform: uppercase;
}

.linklounge-modal {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 2, 5, 0.78);
  backdrop-filter: blur(8px);
}

.linklounge-modal.hidden { display: none; }

.linklounge-profile-card,
.linklounge-directory-card {
  position: relative;
  width: min(520px, 100%);
  max-height: min(760px, calc(100vh - 44px));
  overflow-y: auto;
  padding: 30px;
  border: 1px solid rgba(85, 230, 255, 0.55);
  border-radius: 6px;
  background: #0a0e13;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7), 0 0 32px rgba(85, 230, 255, 0.08);
}

.linklounge-directory-card { width: min(680px, 100%); }

.linklounge-profile-card > small,
.linklounge-directory-card > small {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.linklounge-profile-card h3,
.linklounge-directory-card h3 {
  margin: 8px 48px 4px 0;
  font-size: 1.8rem;
}

.linklounge-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  font-size: 1.6rem;
}

.linklounge-profile-role {
  margin: 0 0 20px;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.linklounge-strikes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, 26px);
  gap: 10px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.035);
}

.linklounge-strikes span {
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: uppercase;
}

.linklounge-strikes i {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  background: transparent;
}

.linklounge-strikes i.filled {
  border-color: #ff5b53;
  background: #ff3f42;
  box-shadow: 0 0 14px rgba(255, 63, 66, 0.55);
}

.linklounge-profile-note {
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.88rem;
  line-height: 1.45;
}

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

.linklounge-profile-actions button {
  min-height: 48px;
  border: 1px solid rgba(85, 230, 255, 0.42);
  border-radius: 4px;
  background: rgba(85, 230, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}

.linklounge-profile-actions button:disabled { opacity: 0.38; cursor: not-allowed; }
.linklounge-profile-actions button.danger { border-color: rgba(255, 91, 83, 0.58); color: #ff8a83; }

.linklounge-profile-evidence {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.linklounge-profile-evidence h4 { margin: 0 0 12px; font-size: 1rem; text-transform: uppercase; }
.linklounge-profile-evidence ol { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.linklounge-profile-evidence li { padding: 12px; border-left: 3px solid var(--red); background: rgba(255, 91, 83, 0.07); }
.linklounge-profile-evidence li p { margin: 5px 0 0; font-family: Inter, ui-sans-serif, system-ui, sans-serif; overflow-wrap: anywhere; }
.linklounge-profile-evidence li small { color: var(--muted); }

#linklounge-directory-search {
  width: 100%;
  min-height: 48px;
  margin: 18px 0;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

#linklounge-directory-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
#linklounge-directory-list button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 16px;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
#linklounge-directory-list button:hover { border-color: var(--cyan); }
#linklounge-directory-list button span { font-weight: 900; }
#linklounge-directory-list button small { color: var(--muted); }
#linklounge-directory-list button b { grid-row: 1 / 3; grid-column: 2; align-self: center; color: var(--red); font-size: 0.76rem; text-transform: uppercase; }

@media (max-width: 880px) {
  .linklounge-layout {
    grid-template-columns: 210px minmax(0, 1fr);
    padding: 0;
  }

  .linklounge-people { display: none; }
}

@media (max-width: 760px) {
  .linklounge-toggle { display: none !important; }

  .mobile-linklounge-toggle {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    min-height: 28px;
    padding: 5px 8px;
    border: 1px solid rgba(85, 230, 255, 0.58);
    border-radius: 4px;
    background: rgba(7, 12, 14, 0.82);
    color: var(--cyan);
    font-size: 0.65rem;
    font-weight: 950;
    text-transform: uppercase;
  }

  .menu-linklounge-toggle {
    width: min(100%, 300px);
    min-height: 46px;
    margin-top: 12px;
  }

  .linklounge-panel {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .linklounge-head {
    min-height: 66px;
    padding: 10px 12px;
  }

  .linklounge-signal { width: 36px; height: 36px; }
  .linklounge-signal::after { inset: 15px; }
  .linklounge-signal i { top: 17px; left: 17px; width: 10px; height: 10px; }
  .linklounge-head h2 { font-size: 1.5rem; }
  .linklounge-head small { font-size: 0.64rem; }
  #linklounge-developer-status { display: none; }
  .linklounge-head-status { gap: 8px; }
  #linklounge-close { width: 40px; height: 40px; }

  .linklounge-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .linklounge-rooms {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .linklounge-rooms button {
    flex: 0 0 auto;
    min-height: 48px;
    margin: 0;
    padding: 8px 10px;
  }

  .linklounge-rooms button span { font-size: 0.82rem; }
  .linklounge-rooms button small,
  .linklounge-safety-note { display: none; }

  .linklounge-room-head { min-height: 58px; padding: 9px 13px; }
  .linklounge-room-head h3 { font-size: 1.15rem; }
  .linklounge-messages { padding: 8px 13px 18px; }
  .linklounge-message { grid-template-columns: 32px minmax(0, 1fr); gap: 8px; padding: 10px 0; }
  .linklounge-avatar { width: 29px; height: 29px; }
  .linklounge-message-body > p { font-size: 0.95rem; }
  .linklounge-form { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .linklounge-form > div { grid-template-columns: minmax(0, 1fr) 72px; }
  .linklounge-form input { min-height: 44px; font-size: 16px; }
  .linklounge-modal { padding: 10px; }
  .linklounge-profile-card,
  .linklounge-directory-card { max-height: calc(100vh - 20px); padding: 22px 16px; }
  .linklounge-profile-actions { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .linklounge-panel * { transition: none !important; }
}
