:root {
  --live-ink: #070b0d;
  --live-paper: #f5f3ea;
  --live-cyan: #20c7df;
  --live-coral: #ff575d;
  --live-lime: #b8ef29;
  --live-gold: #ffc34a;
  --live-line: rgba(255, 255, 255, 0.22);
}

body[data-account-open="true"] {
  overflow: hidden;
}

.account-live-modal {
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 2vw, 28px);
}

.account-live-modal .account-backdrop {
  background: rgba(3, 7, 9, 0.92);
}

.account-live-modal .astra-live-dashboard {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: min(1500px, calc(100vw - clamp(20px, 4vw, 56px)));
  height: min(900px, calc(100dvh - clamp(20px, 4vw, 56px)));
  min-height: 640px;
  max-width: none;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background: var(--live-ink);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.68);
  isolation: isolate;
}

.astra-live-dashboard::before,
.astra-live-dashboard::after {
  position: absolute;
  z-index: 2;
  content: "";
  pointer-events: none;
}

.astra-live-dashboard::before {
  top: 0;
  left: 0;
  width: min(28vw, 380px);
  height: 8px;
  background: var(--live-coral);
  clip-path: polygon(0 0, 100% 0, 91% 100%, 0 100%);
}

.astra-live-dashboard::after {
  right: 0;
  bottom: 0;
  width: min(34vw, 480px);
  height: 7px;
  background: var(--live-lime);
  clip-path: polygon(8% 0, 100% 0, 100% 100%, 0 100%);
}

.astra-live-art,
.astra-live-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.astra-live-art {
  z-index: 0;
  object-fit: cover;
  object-position: center;
  transform: scale(1.012);
  animation: astra-live-breathe 16s ease-in-out infinite alternate;
}

.astra-live-shade {
  z-index: 1;
  background: rgba(2, 6, 8, 0.17);
  box-shadow: inset 0 0 140px rgba(0, 0, 0, 0.44);
}

.astra-live-topbar {
  position: absolute;
  z-index: 8;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 1fr auto 46px;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 12px clamp(16px, 2.2vw, 32px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(4, 9, 11, 0.82);
  backdrop-filter: blur(16px) saturate(1.2);
}

.astra-live-wordmark {
  position: static;
  width: max-content;
  color: #fff;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.8));
}

.astra-live-network {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 1px 8px;
  color: #fff;
  font-family: "Barlow Condensed", sans-serif;
  line-height: 1;
}

.astra-live-network .live-dot {
  grid-row: span 2;
}

.astra-live-network strong {
  font-size: 14px;
}

.astra-live-network small {
  color: var(--live-lime);
  font-size: 10px;
}

.astra-live-topbar .account-close {
  position: static;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 3px;
  background: rgba(4, 9, 11, 0.76);
  color: #fff;
}

.astra-live-topbar .account-close svg {
  width: 20px;
  height: 20px;
}

.astra-live-grid {
  position: absolute;
  z-index: 5;
  inset: 94px clamp(18px, 2.3vw, 34px) 60px;
  display: grid;
  grid-template-columns: minmax(290px, 360px) minmax(300px, 390px);
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  pointer-events: none;
}

.astra-live-identity,
.astra-live-chat {
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background: rgba(5, 11, 13, 0.9);
  color: #f7f8f4;
  box-shadow: 12px 14px 0 rgba(5, 10, 12, 0.27), 0 24px 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(17px) saturate(1.1);
}

.astra-live-identity {
  position: relative;
  display: grid;
  gap: 15px;
  padding: clamp(18px, 2.2vw, 28px);
  overflow: hidden;
}

.astra-live-identity::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 74px;
  height: 5px;
  background: var(--live-coral);
  content: "";
}

.astra-live-identity[data-state="connected"]::before {
  width: 100%;
  background: var(--live-lime);
}

.astra-live-provider {
  display: flex;
  align-items: center;
  gap: 13px;
}

.astra-live-provider .account-openai-plate {
  position: relative;
  inset: auto;
  display: grid;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 2px solid #0b1114;
  border-radius: 3px;
  background: var(--live-paper);
  transform: rotate(-3deg);
  box-shadow: 6px 6px 0 var(--live-coral);
}

.astra-live-provider .account-openai-plate img {
  width: 30px;
  height: 30px;
}

.astra-live-provider > div {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.astra-live-provider small,
.astra-live-provider span {
  color: #9bb3b5;
  font-size: 10px;
  font-weight: 800;
}

.astra-live-provider strong {
  overflow-wrap: anywhere;
  font: 800 clamp(31px, 3.5vw, 48px)/0.9 "Barlow Condensed", sans-serif;
  text-transform: uppercase;
}

.astra-live-provider span {
  margin-top: 5px;
  color: var(--live-gold);
}

.astra-live-identity > p {
  margin: 0;
  color: #c2d0cf;
  font-size: 12px;
  line-height: 1.5;
}

.astra-live-dashboard .account-provider-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: 0;
}

.astra-live-dashboard .account-chatgpt-connect,
.astra-live-dashboard .account-secondary {
  min-height: 56px;
  margin: 0;
  border-radius: 3px;
}

.astra-live-dashboard .account-chatgpt-connect {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  gap: 10px;
  padding: 9px 13px;
  border: 0;
  background: var(--live-paper);
  color: var(--live-ink);
  text-align: left;
}

.astra-live-dashboard .account-chatgpt-connect:hover {
  background: var(--live-lime);
}

.astra-live-dashboard .account-chatgpt-button-mark {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
}

.astra-live-dashboard .account-chatgpt-button-copy small {
  color: #4a5556;
  letter-spacing: 0;
}

.astra-live-dashboard .account-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(7, 13, 15, 0.86);
  color: #fff;
}

.astra-live-dashboard .account-secondary svg {
  width: 17px;
  height: 17px;
}

.astra-live-dashboard .account-feedback {
  min-height: 15px;
  margin: -6px 0 0;
  color: var(--live-gold);
  font-size: 10px;
}

.astra-live-room-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.astra-live-room-actions button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 3px;
  background: rgba(13, 24, 28, 0.9);
  color: #fff;
  text-align: left;
}

.astra-live-room-actions button:first-child {
  border-color: var(--live-lime);
  background: rgba(31, 45, 22, 0.92);
}

.astra-live-room-actions button:hover {
  transform: translateY(-2px);
  border-color: #fff;
}

.astra-live-room-actions svg {
  width: 25px;
  height: 25px;
}

.astra-live-room-actions span {
  display: grid;
  gap: 2px;
}

.astra-live-room-actions strong {
  font-size: 11px;
}

.astra-live-room-actions small {
  color: #93a7a8;
  font-size: 8px;
}

.astra-live-dashboard .account-privacy {
  color: #829294;
  font-size: 9px;
}

.astra-live-chat {
  display: grid;
  grid-template-rows: auto minmax(180px, 1fr) auto;
  min-height: 440px;
  max-height: 70vh;
  overflow: hidden;
}

.astra-live-chat > header,
.studio-world-chat > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 55px;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(4, 10, 12, 0.86);
}

.astra-live-chat > header > div,
.studio-world-chat > header > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.astra-live-chat header strong,
.studio-world-chat header strong {
  font: 800 14px/1 "Barlow Condensed", sans-serif;
}

.astra-live-chat header small,
.studio-world-chat header small {
  color: var(--live-gold);
  font-size: 8px;
  font-weight: 800;
}

[data-live-chat-list] {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  margin: 0;
  padding: 14px;
  overflow-y: auto;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: var(--live-cyan) transparent;
}

.astra-live-message {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 9px;
  padding: 9px 10px;
  border-left: 3px solid var(--live-cyan);
  background: rgba(17, 31, 34, 0.9);
}

.astra-live-message[data-own="true"] {
  border-left-color: var(--live-lime);
  background: rgba(29, 43, 25, 0.92);
}

.astra-live-message[data-system="true"] {
  border-left-color: var(--live-gold);
}

.astra-live-message strong,
.astra-live-message time {
  font-size: 9px;
  line-height: 1;
}

.astra-live-message strong {
  color: var(--live-cyan);
  text-transform: uppercase;
}

.astra-live-message time {
  justify-self: end;
  color: #718184;
}

.astra-live-message p {
  grid-column: 1 / -1;
  margin: 0;
  overflow-wrap: anywhere;
  color: #e8eeee;
  font-size: 12px;
  line-height: 1.35;
}

[data-live-chat-form] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(3, 8, 10, 0.9);
}

[data-live-chat-input] {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 3px;
  outline: 0;
  background: rgba(15, 25, 28, 0.96);
  color: #fff;
  font: 500 13px/1.2 Inter, sans-serif;
}

[data-live-chat-input]:focus {
  border-color: var(--live-cyan);
  box-shadow: 0 0 0 2px rgba(32, 199, 223, 0.18);
}

[data-live-chat-input]:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

[data-live-chat-form] button {
  display: grid;
  width: 48px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 3px;
  background: var(--live-lime);
  color: #07100b;
}

[data-live-chat-form] button:disabled {
  opacity: 0.5;
}

[data-live-chat-form] svg {
  width: 19px;
  height: 19px;
}

.astra-live-dock {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 14px;
  display: flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  background: rgba(4, 9, 11, 0.88);
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

.astra-live-dock button {
  display: grid;
  grid-template-columns: 18px auto;
  align-items: center;
  gap: 6px;
  min-width: 74px;
  height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: #a9b8ba;
  font-size: 9px;
  font-weight: 800;
}

.astra-live-dock button.is-active,
.astra-live-dock button:hover {
  background: var(--live-paper);
  color: var(--live-ink);
}

.astra-live-dock svg {
  width: 17px;
  height: 17px;
}

.astra-live-dashboard > .account-legal {
  position: absolute;
  z-index: 8;
  right: 24px;
  bottom: 20px;
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
}

.studio-launch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.studio-launch button svg {
  width: 17px;
  height: 17px;
}

.studio-launch .studio-live-open {
  background: var(--live-paper);
  color: var(--live-ink);
}

.identity-studio[data-studio-mode="world"] .studio-room-hud {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.studio-world-commands {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.studio-room-hud .studio-world-commands button {
  position: relative;
  display: inline-flex;
  min-width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
}

.studio-world-commands button svg {
  width: 18px;
  height: 18px;
}

.studio-world-commands [data-gpu-mode] span {
  font-size: 8px;
}

.studio-world-commands [data-live-unread] {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--live-coral);
  color: #fff;
  font-size: 8px;
}

.studio-world-chat {
  position: absolute;
  z-index: 24;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto minmax(160px, 1fr) auto;
  width: min(380px, calc(100vw - 36px));
  height: min(490px, calc(100dvh - 112px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background: rgba(5, 11, 13, 0.92);
  color: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
}

.studio-world-chat[hidden] {
  display: none !important;
}

.studio-world-chat header button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
}

.studio-world-chat header button svg {
  width: 16px;
  height: 16px;
}

@keyframes astra-live-breathe {
  from { transform: scale(1.012) translate3d(-0.2%, 0, 0); }
  to { transform: scale(1.045) translate3d(0.45%, -0.35%, 0); }
}

@media (max-width: 900px) {
  .identity-studio:not([data-studio-mode="world"]) .studio-launch {
    right: 10px;
    bottom: 68px;
    left: 10px;
    z-index: 12;
    display: flex;
    gap: 7px;
  }

  .identity-studio:not([data-studio-mode="world"]) .studio-launch button {
    display: inline-flex;
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    padding: 0 10px;
    font-size: 8px;
  }

  .account-live-modal {
    padding: 0;
  }

  .account-live-modal .astra-live-dashboard {
    width: 100vw;
    height: 100dvh;
    min-height: 0;
    border: 0;
    border-radius: 0;
  }

  .astra-live-art {
    height: 46%;
    object-position: 49% center;
  }

  .astra-live-shade {
    background: rgba(4, 9, 11, 0.14);
    box-shadow: inset 0 -24vh 60px rgba(4, 9, 11, 0.82);
  }

  .astra-live-topbar {
    grid-template-columns: 1fr auto 42px;
    min-height: 62px;
    padding: max(9px, env(safe-area-inset-top)) 12px 9px;
  }

  .astra-live-network {
    display: none;
  }

  .astra-live-topbar .account-close {
    grid-column: 3;
    width: 38px;
    height: 38px;
  }

  .astra-live-grid {
    inset: 42% 10px calc(69px + env(safe-area-inset-bottom));
    display: block;
  }

  .astra-live-identity,
  .astra-live-chat {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    box-shadow: none;
  }

  .astra-live-identity {
    align-content: start;
    gap: 10px;
    padding: 15px;
    overflow-y: auto;
  }

  .astra-live-provider .account-openai-plate {
    flex-basis: 46px;
    width: 46px;
    height: 46px;
  }

  .astra-live-provider strong {
    font-size: clamp(29px, 9vw, 40px);
  }

  .astra-live-chat {
    display: none;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .astra-live-dashboard[data-live-mobile-view="chat"] .astra-live-identity {
    display: none;
  }

  .astra-live-dashboard[data-live-mobile-view="chat"] .astra-live-chat {
    display: grid;
  }

  .astra-live-dashboard .account-privacy,
  .astra-live-dashboard > .account-legal {
    display: none;
  }

  .astra-live-dock {
    left: 10px;
    right: 10px;
    bottom: max(8px, env(safe-area-inset-bottom));
    justify-content: stretch;
    transform: none;
  }

  .astra-live-dock button {
    grid-template-columns: 18px auto;
    flex: 1;
    justify-content: center;
    min-width: 0;
  }

  .identity-studio[data-studio-mode="world"] .studio-room-hud {
    top: max(8px, env(safe-area-inset-top));
    left: 8px;
    right: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
  }

  .studio-room-hud .studio-world-status {
    display: none;
  }

  .studio-world-commands [data-gpu-mode] span {
    display: none;
  }

  .studio-room-hud .studio-world-commands button {
    width: 40px;
    min-width: 40px;
    padding: 0;
  }

  .studio-world-chat {
    left: 8px;
    right: 8px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: auto;
    height: min(54dvh, 470px);
  }
}

@media (max-width: 420px) {
  .astra-live-grid {
    top: 39%;
  }

  .astra-live-room-actions button {
    grid-template-columns: 23px minmax(0, 1fr);
    min-height: 52px;
  }

  .astra-live-room-actions svg {
    width: 21px;
    height: 21px;
  }

  .astra-live-dashboard .account-chatgpt-button-copy small {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .astra-live-art {
    animation: none;
  }
}
