:root {
  --is-chat-green: #42ff76;
  --is-chat-green-hot: #b8ff45;
  --is-chat-bg: #020604;
  --is-chat-panel: #07100b;
  --is-chat-line: rgba(66, 255, 118, 0.24);
  --is-chat-muted: #779682;
  --is-chat-text: #d8ffe1;
  --is-chat-danger: #ff6d63;
}

.is-chat-shell {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2147483000;
  color: var(--is-chat-text);
  font-family: "Share Tech Mono", "Courier New", monospace;
}

.is-chat-launcher {
  position: relative;
  display: flex;
  min-height: 50px;
  align-items: center;
  gap: 10px;
  padding: 0 17px;
  border: 1px solid var(--is-chat-green);
  border-radius: 2px;
  color: #001b08;
  background: linear-gradient(135deg, #c5ff51, #42ff76 58%, #1bdc55);
  box-shadow: 0 0 0 1px #031409, 0 0 32px rgba(66, 255, 118, 0.25), 0 16px 44px #000c;
  font: 700 12px/1 "Share Tech Mono", monospace;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  cursor: pointer;
}

.is-chat-launcher::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(0, 24, 7, 0.35);
  pointer-events: none;
}

.is-chat-launcher > span:first-child {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid #03250d;
  font-size: 15px;
}

.is-chat-unread {
  position: absolute;
  top: -9px;
  right: -9px;
  min-width: 22px;
  height: 22px;
  box-sizing: border-box;
  padding: 0 5px;
  border: 2px solid #020604;
  border-radius: 50%;
  color: #fff;
  background: #e84940;
  font-size: 10px;
  line-height: 18px;
  text-align: center;
}

.is-chat-panel {
  position: absolute;
  right: 0;
  bottom: 64px;
  display: none;
  width: min(410px, calc(100vw - 28px));
  height: min(650px, calc(100dvh - 100px));
  overflow: hidden;
  border: 1px solid rgba(66, 255, 118, 0.48);
  border-radius: 3px;
  background:
    radial-gradient(circle at 100% 0, rgba(66, 255, 118, 0.14), transparent 31%),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(66, 255, 118, 0.026) 32px),
    var(--is-chat-bg);
  box-shadow: 0 0 45px rgba(66, 255, 118, 0.12), 0 30px 90px #000d;
}

.is-chat-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 4px double rgba(66, 255, 118, 0.07);
  pointer-events: none;
}

.is-chat-shell.is-open .is-chat-panel {
  display: flex;
  flex-direction: column;
  animation: is-chat-boot 180ms steps(4, end);
}

.is-chat-header {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 70px;
  grid-template-columns: 42px 1fr 34px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--is-chat-line);
  background: linear-gradient(90deg, rgba(66, 255, 118, 0.1), transparent 70%);
}

.is-chat-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(66, 255, 118, 0.65);
  color: var(--is-chat-green);
  background: rgba(66, 255, 118, 0.06);
  box-shadow: inset 0 0 14px rgba(66, 255, 118, 0.08);
  font-size: 18px;
}

.is-chat-header small,
.is-chat-eyebrow {
  display: block;
  color: var(--is-chat-green);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.is-chat-header strong {
  display: block;
  margin-top: 4px;
  color: #effff2;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.is-chat-icon,
.is-chat-link,
.is-chat-message button {
  border: 0;
  color: var(--is-chat-muted);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.is-chat-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid transparent;
}

.is-chat-icon:hover,
.is-chat-link:hover {
  border-color: var(--is-chat-line);
  color: var(--is-chat-green);
}

.is-chat-gate {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 30px;
  flex-direction: column;
  text-align: center;
}

.is-chat-seal {
  display: grid;
  width: 78px;
  height: 78px;
  margin-bottom: 23px;
  place-items: center;
  border: 1px solid rgba(66, 255, 118, 0.65);
  outline: 1px solid rgba(66, 255, 118, 0.14);
  outline-offset: 7px;
  color: var(--is-chat-green);
  background: radial-gradient(circle, rgba(66, 255, 118, 0.13), transparent 68%);
  font-size: 25px;
}

.is-chat-gate h3 {
  margin: 8px 0 0;
  color: #effff2;
  font-size: 24px;
  font-weight: 500;
}

.is-chat-gate p:not(.is-chat-eyebrow) {
  max-width: 320px;
  margin: 13px 0 20px;
  color: var(--is-chat-muted);
  font-size: 12px;
  line-height: 1.65;
}

.is-chat-gate-actions {
  display: grid;
  width: 100%;
  gap: 8px;
}

.is-chat-primary,
.is-chat-secondary {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--is-chat-green);
  border-radius: 2px;
  font: 700 11px/1 "Share Tech Mono", monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.is-chat-primary {
  color: #001b08;
  background: linear-gradient(135deg, var(--is-chat-green-hot), var(--is-chat-green));
}

.is-chat-secondary {
  color: var(--is-chat-green);
  background: rgba(66, 255, 118, 0.06);
}

.is-chat-primary:disabled,
.is-chat-secondary:disabled {
  cursor: wait;
  filter: grayscale(0.7);
  opacity: 0.55;
}

.is-chat-gate em {
  margin-top: 13px;
  color: #66816e;
  font-size: 9px;
  font-style: normal;
}

.is-chat-error {
  width: 100%;
  box-sizing: border-box;
  margin: 10px 0 0;
  padding: 9px 11px;
  border-left: 2px solid var(--is-chat-danger);
  color: #ffc3bf;
  background: rgba(255, 77, 66, 0.1);
  font-size: 11px;
  line-height: 1.4;
}

.is-chat-app {
  display: none;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.is-chat-identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 13px;
  border-bottom: 1px solid rgba(66, 255, 118, 0.12);
  background: rgba(255, 255, 255, 0.018);
}

.is-chat-identity-copy {
  min-width: 0;
}

.is-chat-identity-copy strong,
.is-chat-identity-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.is-chat-identity-copy strong {
  color: #e9ffed;
  font-size: 13px;
  font-weight: 500;
}

.is-chat-identity-copy small {
  margin-top: 2px;
  color: var(--is-chat-green);
  font-size: 9px;
}

.is-chat-identity-actions {
  display: flex;
  gap: 3px;
}

.is-chat-link {
  padding: 5px 6px;
  font-size: 9px;
}

.is-chat-profile {
  display: none;
  padding: 11px 13px;
  border-bottom: 1px solid var(--is-chat-line);
  background: rgba(66, 255, 118, 0.04);
}

.is-chat-profile.is-open {
  display: block;
}

.is-chat-profile label {
  display: block;
  margin-bottom: 6px;
  color: var(--is-chat-green);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.is-chat-profile-row,
.is-chat-add-mod {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.is-chat-profile input,
.is-chat-add-mod input,
.is-chat-composer textarea {
  min-width: 0;
  border: 1px solid rgba(66, 255, 118, 0.27);
  border-radius: 2px;
  outline: 0;
  color: var(--is-chat-text);
  background: rgba(255, 255, 255, 0.04);
  font: 11px/1.4 "Share Tech Mono", monospace;
}

.is-chat-profile input,
.is-chat-add-mod input {
  padding: 8px 9px;
}

.is-chat-profile input:focus,
.is-chat-add-mod input:focus,
.is-chat-composer textarea:focus {
  border-color: var(--is-chat-green);
  box-shadow: 0 0 0 2px rgba(66, 255, 118, 0.08);
}

.is-chat-profile button,
.is-chat-add-mod button,
.is-chat-mod button {
  border: 1px solid rgba(66, 255, 118, 0.5);
  border-radius: 2px;
  padding: 6px 9px;
  color: var(--is-chat-green);
  background: rgba(66, 255, 118, 0.07);
  font: 9px "Share Tech Mono", monospace;
  cursor: pointer;
}

.is-chat-room-title {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 10px 13px 7px;
}

.is-chat-room-title strong {
  color: #eaffee;
  font-size: 13px;
  font-weight: 500;
}

.is-chat-live {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--is-chat-green);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.is-chat-live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--is-chat-green);
  box-shadow: 0 0 9px var(--is-chat-green);
  animation: is-chat-blink 1.5s steps(1, end) infinite;
}

.is-chat-messages {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 4px 13px 14px;
  scrollbar-color: rgba(66, 255, 118, 0.32) transparent;
}

.is-chat-empty {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  color: #577060;
  font-size: 10px;
  text-align: center;
}

.is-chat-message {
  margin: 11px 0;
}

.is-chat-meta {
  display: flex;
  min-height: 17px;
  align-items: center;
  gap: 7px;
  color: #6e8b76;
  font-size: 8px;
}

.is-chat-meta strong {
  color: #cbeed2;
  font-size: 10px;
  font-weight: 500;
}

.is-chat-meta span {
  padding: 1px 4px;
  border: 1px solid rgba(66, 255, 118, 0.22);
  color: var(--is-chat-green);
  text-transform: uppercase;
}

.is-chat-meta time {
  margin-left: auto;
}

.is-chat-message > p {
  display: inline-block;
  max-width: 88%;
  margin: 4px 0 0;
  padding: 8px 10px;
  border: 1px solid rgba(66, 255, 118, 0.11);
  border-radius: 2px 9px 9px;
  color: #cfe9d4;
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.is-chat-message.is-mine {
  text-align: right;
}

.is-chat-message.is-mine .is-chat-meta {
  flex-direction: row-reverse;
}

.is-chat-message.is-mine .is-chat-meta time {
  margin-right: auto;
  margin-left: 0;
}

.is-chat-message.is-mine > p {
  border-color: rgba(66, 255, 118, 0.27);
  border-radius: 9px 2px 9px 9px;
  color: #effff2;
  background: rgba(66, 255, 118, 0.09);
  text-align: left;
}

.is-chat-message > p.is-deleted {
  color: #5f7564;
  font-style: italic;
}

.is-chat-message-tools {
  display: inline-flex;
  gap: 7px;
  margin-top: 4px;
}

.is-chat-message-tools button {
  padding: 0;
  color: #5d7562;
  font-size: 8px;
}

.is-chat-message-tools button:hover {
  color: var(--is-chat-green);
}

.is-chat-composer {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 8px;
  padding: 10px 12px 17px;
  border-top: 1px solid var(--is-chat-line);
  background: rgba(1, 5, 3, 0.94);
}

.is-chat-composer textarea {
  min-height: 42px;
  max-height: 90px;
  box-sizing: border-box;
  resize: none;
  padding: 8px 9px;
}

.is-chat-composer > button {
  display: grid;
  place-items: center;
  border: 1px solid var(--is-chat-green);
  border-radius: 2px;
  color: #002009;
  background: linear-gradient(145deg, var(--is-chat-green-hot), var(--is-chat-green));
  font-size: 17px;
  cursor: pointer;
}

.is-chat-composer > button:disabled {
  cursor: default;
  filter: grayscale(0.8);
  opacity: 0.35;
}

.is-chat-composer small {
  position: absolute;
  right: 64px;
  bottom: 4px;
  color: #536b58;
  font-size: 8px;
}

.is-chat-mod {
  display: none;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 12px 13px 18px;
}

.is-chat-mod.is-open {
  display: block;
}

.is-chat-mod-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--is-chat-line);
}

.is-chat-mod-head strong {
  color: #eaffee;
  font-size: 16px;
  font-weight: 500;
}

.is-chat-mod section {
  padding: 12px 0;
  border-bottom: 1px solid rgba(66, 255, 118, 0.1);
}

.is-chat-mod h3 {
  margin: 0 0 8px;
  color: var(--is-chat-green);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.is-chat-mod-card {
  margin: 7px 0;
  padding: 9px;
  border: 1px solid rgba(66, 255, 118, 0.14);
  background: rgba(255, 255, 255, 0.025);
  font-size: 9px;
  line-height: 1.5;
}

.is-chat-mod-card blockquote {
  margin: 7px 0;
  padding: 7px 8px;
  border-left: 2px solid rgba(66, 255, 118, 0.38);
  color: #bdd5c2;
  background: #0005;
  overflow-wrap: anywhere;
}

.is-chat-mod-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.is-chat-mod button.is-danger {
  border-color: rgba(255, 109, 99, 0.45);
  color: #ffaaa4;
  background: rgba(255, 109, 99, 0.07);
}

@keyframes is-chat-blink {
  0%, 55% { opacity: 1; }
  56%, 100% { opacity: 0.2; }
}

@keyframes is-chat-boot {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  .is-chat-shell { right: 12px; bottom: 12px; }
  .is-chat-launcher { width: 52px; padding: 0; justify-content: center; border-radius: 50%; }
  .is-chat-launcher::before { border-radius: 50%; }
  .is-chat-launcher > strong { display: none; }
  .is-chat-panel {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .is-chat-shell.is-open .is-chat-panel { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .is-chat-shell.is-open .is-chat-panel,
  .is-chat-live i { animation: none; }
}
