:root {
  --bg: #030712;
  --panel: rgba(8, 18, 34, 0.82);
  --panel-soft: rgba(255, 255, 255, 0.055);
  --line: rgba(118, 230, 255, 0.22);
  --line-strong: rgba(100, 255, 225, 0.54);
  --text: #eff8ff;
  --muted: rgba(225, 237, 248, 0.68);
  --cyan: #72e8ff;
  --teal: #66f0d7;
  --amber: #f8c86d;
  --red: #ff7b9c;
  --radius: 8px;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 78% 10%, rgba(102, 240, 215, 0.12), transparent 32%),
    radial-gradient(circle at 12% 86%, rgba(114, 232, 255, 0.1), transparent 36%),
    linear-gradient(180deg, #06111f, #030712 48%, #02040c);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.icon {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.icon-button-primary {
  color: #031014 !important;
  background: linear-gradient(135deg, var(--teal), var(--cyan)) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
  box-shadow: 0 12px 28px rgba(102, 240, 215, 0.18);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.orbital-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(118, 230, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(118, 230, 255, 0.028) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
}

.app-shell {
  min-height: 100vh;
  padding: 18px;
}

.login-panel {
  width: min(440px, calc(100vw - 32px));
  margin: 9vh auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  background:
    linear-gradient(180deg, rgba(8, 18, 34, 0.92), rgba(3, 7, 18, 0.82)),
    var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--teal);
  background: rgba(102, 240, 215, 0.12);
  font-weight: 950;
}

.login-panel > span,
.rail-head span,
.deck-head span,
.signal-card span,
.astra-core span,
.location-card span,
.search-card span,
.babyphone-card span,
.calendar-card span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.login-panel h1 {
  margin: 14px 0 22px;
  font-size: clamp(2rem, 6vw, 3.2rem);
  line-height: 0.95;
}

.login-panel form,
.login-panel label {
  display: grid;
  gap: 10px;
}

.login-panel form {
  gap: 14px;
}

.login-panel input,
.composer textarea {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(0, 0, 0, 0.24);
  outline: none;
}

.login-panel input {
  height: 46px;
  padding: 0 13px;
}

.login-panel input:focus,
.composer textarea:focus {
  border-color: rgba(114, 232, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(114, 232, 255, 0.12);
}

.login-panel button,
.composer button,
.deck-head button {
  border: 1px solid rgba(102, 240, 215, 0.44);
  border-radius: var(--radius);
  color: #e9fffb;
  background: rgba(20, 140, 128, 0.34);
  font-weight: 900;
}

.login-panel button {
  min-height: 46px;
}

.error-line {
  min-height: 20px;
  margin: 0;
  color: #ffd1dc;
  font-size: 0.84rem;
}

.is-hidden {
  display: none !important;
}

.chat-layout {
  height: calc(100vh - 36px);
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 250px;
  gap: 14px;
}

.room-rail,
.message-deck,
.astra-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(8, 18, 34, 0.86), rgba(3, 7, 18, 0.78)),
    var(--panel);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.34);
}

.room-rail,
.astra-panel {
  padding: 14px;
}

.rail-head,
.astra-core {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rail-head strong,
.astra-core strong,
.profile-card strong {
  display: block;
  margin-top: 2px;
}

.room-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.room-group-title {
  margin: 12px 2px 2px;
  color: rgba(225, 237, 248, 0.48);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.rail-action {
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  border: 1px solid rgba(102, 240, 215, 0.34);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(20, 140, 128, 0.18);
  font-weight: 950;
}

.room-button {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(118, 230, 255, 0.16);
  border-radius: var(--radius);
  padding: 9px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  text-align: left;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.room-button.is-active {
  border-color: var(--line-strong);
  background:
    linear-gradient(90deg, rgba(102, 240, 215, 0.16), rgba(114, 232, 255, 0.06)),
    rgba(20, 140, 128, 0.18);
}

.room-button:hover {
  border-color: rgba(118, 230, 255, 0.34);
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-1px);
}

.room-button.is-private .room-glyph {
  color: var(--amber);
  border-color: rgba(248, 200, 109, 0.36);
  background: rgba(248, 200, 109, 0.08);
}

.room-glyph {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(102, 240, 215, 0.28);
  border-radius: var(--radius);
  color: var(--teal);
  background: rgba(102, 240, 215, 0.1);
}

.room-button strong,
.room-button small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-button small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.74rem;
}

.room-badge {
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #031014;
  background: var(--teal);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 950;
  box-shadow: 0 0 20px rgba(102, 240, 215, 0.34);
}

.presence-card {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  border: 1px solid rgba(118, 230, 255, 0.13);
  border-radius: var(--radius);
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.presence-list {
  display: grid;
  gap: 6px;
}

.presence-user {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.presence-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(151, 177, 207, 0.46);
}

.presence-user.online .presence-dot {
  background: var(--teal);
  box-shadow: 0 0 14px rgba(102, 240, 215, 0.7);
}

.presence-user strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.presence-dm {
  min-width: 36px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(102, 240, 215, 0.32);
  border-radius: var(--radius);
  color: var(--teal);
  background: rgba(102, 240, 215, 0.1);
  font-size: 0.72rem;
  font-weight: 950;
}

.presence-dm .icon,
.message-tools .icon {
  width: 15px;
  height: 15px;
}

.search-card,
.profile-card,
.profile-form {
  margin-top: 18px;
  border: 1px solid rgba(118, 230, 255, 0.14);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.search-card {
  display: grid;
  gap: 9px;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 8px;
}

.search-form input {
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 11px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.2);
}

.search-form button,
.calendar-form button {
  min-height: 40px;
  border: 1px solid rgba(102, 240, 215, 0.36);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(20, 140, 128, 0.24);
  font-weight: 900;
}

.search-results {
  display: grid;
  gap: 7px;
  max-height: 220px;
  overflow: auto;
}

.search-results p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.search-result {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(118, 230, 255, 0.12);
  border-radius: var(--radius);
  padding: 8px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.16);
  text-align: left;
}

.search-result span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}

.profile-card span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.profile-card small {
  display: block;
  margin-top: 7px;
  color: var(--teal);
}

.avatar-button,
.message-avatar {
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid rgba(102, 240, 215, 0.42);
  border-radius: 999px;
  color: #eafffb;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.28), transparent 26%),
    linear-gradient(135deg, rgba(20, 140, 128, 0.5), rgba(27, 111, 143, 0.26));
  background-position: center;
  background-size: cover;
  font-weight: 950;
}

.avatar-button {
  width: 52px;
  height: 52px;
}

.profile-form {
  display: grid;
  gap: 9px;
}

.profile-form input {
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 11px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.2);
}

.profile-form button {
  min-height: 38px;
  border: 1px solid rgba(102, 240, 215, 0.36);
  border-radius: var(--radius);
  color: #e9fffb;
  background: rgba(20, 140, 128, 0.26);
  font-weight: 900;
}

.profile-status {
  min-height: 17px;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.message-deck {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.deck-head {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(118, 230, 255, 0.16);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.035);
}

.deck-head h2 {
  margin: 2px 0 0;
  font-size: 1.5rem;
}

.deck-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.deck-actions button {
  min-width: 42px;
  width: 42px;
  height: 42px;
  padding: 0;
}

.deck-actions button:hover {
  color: #eafffb;
}

.message-list {
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
}

.message {
  width: min(760px, 92%);
  margin: 0 0 12px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid rgba(118, 230, 255, 0.16);
  border-radius: var(--radius);
  padding: 11px 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.045)),
    rgba(255, 255, 255, 0.04);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
}

.message.mine {
  margin-left: auto;
  border-color: rgba(114, 232, 255, 0.36);
  background:
    linear-gradient(180deg, rgba(27, 111, 143, 0.28), rgba(10, 48, 72, 0.22)),
    rgba(27, 111, 143, 0.18);
}

.message.astra,
.message.alert {
  border-color: rgba(102, 240, 215, 0.38);
  background: rgba(10, 79, 76, 0.28);
}

.message.alert {
  border-color: rgba(248, 200, 109, 0.46);
  background: rgba(120, 75, 14, 0.22);
}

.message.deleted {
  opacity: 0.72;
}

.message-tombstone {
  width: fit-content;
  max-width: min(420px, 92%);
  display: block;
  margin: 4px auto 10px;
  border-color: rgba(151, 177, 207, 0.14);
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.tombstone-content {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid rgba(151, 177, 207, 0.16);
  border-radius: var(--radius);
  padding: 0 10px;
  color: rgba(225, 237, 248, 0.48);
  background: rgba(255, 255, 255, 0.026);
  font-size: 0.78rem;
  font-weight: 850;
}

.tombstone-content .icon {
  width: 15px;
  height: 15px;
}

.tombstone-content time {
  color: rgba(225, 237, 248, 0.36);
  font-size: 0.72rem;
}

.message-avatar {
  width: 36px;
  height: 36px;
  align-self: start;
  font-size: 0.82rem;
}

.message-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
}

.message-head > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-tools {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  opacity: 0.42;
  transition: opacity 160ms ease;
}

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

.message-tools button,
.message-reactions button,
.emoji-picker button {
  border: 1px solid rgba(118, 230, 255, 0.18);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(0, 0, 0, 0.18);
  font-weight: 900;
}

.message-tools button {
  width: 28px;
  height: 28px;
  padding: 0;
}

.message-body {
  margin-top: 7px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
  color: rgba(239, 248, 255, 0.94);
}

.message-displayed {
  display: block;
  margin-top: 6px;
  color: rgba(225, 237, 248, 0.46);
  font-size: 0.68rem;
  font-weight: 800;
}

.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.message-statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.message-reactions button {
  min-height: 28px;
  padding: 0 8px;
  color: #eafffb;
  background: rgba(20, 140, 128, 0.18);
}

.message-statuses button {
  min-height: 28px;
  border: 1px solid rgba(151, 177, 207, 0.2);
  border-radius: var(--radius);
  padding: 0 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.72rem;
  font-weight: 900;
}

.message-statuses button.is-active {
  border-color: rgba(102, 240, 215, 0.48);
  color: var(--text);
  background: rgba(20, 140, 128, 0.24);
}

.emoji-picker {
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  border: 1px solid rgba(118, 230, 255, 0.18);
  border-radius: var(--radius);
  padding: 8px;
  background: rgba(3, 7, 18, 0.94);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
}

.emoji-picker button {
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 1.05rem;
}

.message-map {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  margin-top: 2px;
  border: 1px solid rgba(102, 240, 215, 0.28);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  background: rgba(0, 18, 28, 0.44);
}

.message-map-visual {
  min-height: 104px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(118, 230, 255, 0.12) 1px, transparent 1px),
    linear-gradient(0deg, rgba(118, 230, 255, 0.10) 1px, transparent 1px),
    radial-gradient(circle at 52% 50%, rgba(102, 240, 215, 0.34), transparent 28%),
    linear-gradient(135deg, rgba(8, 48, 58, 0.95), rgba(8, 100, 86, 0.55));
  background-size: 22px 22px, 22px 22px, auto, auto;
}

.message-map-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.96);
  border-radius: 50% 50% 50% 0;
  transform: translate(-50%, -70%) rotate(-45deg);
  background: var(--teal);
  box-shadow: 0 0 24px rgba(102, 240, 215, 0.72);
}

.message-map-text {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
  padding: 12px 12px 12px 0;
}

.message-map-text strong,
.message-map-text span,
.message-map-text small {
  overflow-wrap: anywhere;
}

.message-map-text span,
.message-map-text small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.message-attachment {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 2px;
  border: 1px solid rgba(118, 230, 255, 0.20);
  border-radius: var(--radius);
  padding: 10px;
  color: var(--text);
  text-decoration: none;
  background: rgba(0, 18, 28, 0.42);
}

.message-attachment.image {
  grid-template-columns: minmax(0, 1fr);
  padding: 0;
  overflow: hidden;
}

.message-attachment img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.28);
}

.message-attachment.image .attachment-text {
  padding: 0 12px 12px;
}

.attachment-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(102, 240, 215, 0.36);
  border-radius: var(--radius);
  color: var(--teal);
  font-size: 0.74rem;
  font-weight: 950;
  background: rgba(20, 140, 128, 0.16);
}

.attachment-text {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.attachment-text strong,
.attachment-text small {
  overflow-wrap: anywhere;
}

.attachment-text small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.composer {
  display: grid;
  position: relative;
  grid-template-columns: minmax(0, 1fr) 52px 52px;
  gap: 10px;
  border-top: 1px solid rgba(118, 230, 255, 0.16);
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(3, 7, 18, 0.22), rgba(3, 7, 18, 0.66)),
    rgba(8, 18, 34, 0.42);
}

.composer-emoji-picker {
  position: absolute;
  right: 72px;
  bottom: 76px;
  width: min(260px, calc(100vw - 42px));
}

.composer-action-menu {
  position: absolute;
  right: 76px;
  bottom: 78px;
  z-index: 15;
  display: grid;
  grid-template-columns: repeat(2, minmax(104px, 1fr));
  gap: 8px;
  width: min(300px, calc(100vw - 34px));
  padding: 10px;
  border: 1px solid rgba(102, 240, 215, 0.32);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(17, 31, 52, 0.98), rgba(5, 13, 25, 0.96)),
    var(--panel);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.48);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.98);
  transition: opacity 150ms ease, transform 150ms ease;
}

.composer-action-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.composer-action-menu button {
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
  padding: 0 12px;
}

.composer-menu-button.is-active {
  border-color: rgba(102, 240, 215, 0.72);
  background: rgba(20, 140, 128, 0.34);
}

.composer textarea {
  min-height: 52px;
  max-height: 150px;
  resize: vertical;
  padding: 14px;
  background: rgba(0, 0, 0, 0.28);
}

.composer button {
  width: 52px;
  min-height: 52px;
  padding: 0;
  font-size: 0.78rem;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.composer .composer-action-menu button {
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
  padding: 0 12px;
}

.mobile-dock {
  display: none;
}

.composer button:hover,
.deck-actions button:hover,
.rail-action:hover,
.presence-dm:hover,
.message-tools button:hover {
  border-color: rgba(102, 240, 215, 0.68);
  background: rgba(20, 140, 128, 0.28);
  transform: translateY(-1px);
}

.composer button:active,
.deck-actions button:active,
.rail-action:active,
.presence-dm:active,
.message-tools button:active {
  transform: translateY(0);
}

.target-picker.is-disabled {
  opacity: 0.45;
  filter: grayscale(0.25);
}

.babyphone-room-panel,
.collab-panel {
  border-bottom: 1px solid rgba(118, 230, 255, 0.16);
  padding: 14px 18px;
}

.babyphone-room-panel {
  position: relative;
}

.babyphone-room-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.babyphone-room-head span,
.collab-status {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.babyphone-room-head button,
.collab-card button,
.poll-form button,
.collab-disagreement button {
  border: 1px solid rgba(102, 240, 215, 0.38);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(20, 140, 128, 0.18);
  font-weight: 900;
  min-height: 38px;
  padding: 0 12px;
}

.babyphone-room-image {
  position: relative;
  aspect-ratio: 16 / 8;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(118, 230, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.22);
}

.babyphone-room-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.babyphone-room-panel .babyphone-facts {
  position: absolute;
  top: 82px;
  left: 30px;
  right: 30px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  pointer-events: none;
}

.babyphone-room-panel .babyphone-fact {
  min-width: 116px;
  backdrop-filter: blur(12px);
  border-color: rgba(118, 230, 255, 0.22);
  background: rgba(3, 10, 20, 0.48);
}

.collab-panel {
  display: grid;
  gap: 12px;
}

.collab-drawer {
  position: fixed;
  z-index: 40;
  top: 0;
  right: 0;
  width: min(720px, calc(100vw - 24px));
  height: 100vh;
  overflow: auto;
  border-left: 1px solid rgba(118, 230, 255, 0.24);
  border-bottom: 0;
  box-shadow: -28px 0 70px rgba(0, 0, 0, 0.42);
  background:
    linear-gradient(180deg, rgba(8, 18, 32, 0.98), rgba(5, 12, 24, 0.98)),
    var(--panel);
  transform: translateX(104%);
  transition: transform 180ms ease;
}

.collab-drawer.is-open {
  transform: translateX(0);
}

.collab-drawer-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.collab-drawer-head span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.collab-drawer-head strong {
  display: block;
  font-size: 1.2rem;
}

.collab-drawer-head button {
  border: 1px solid rgba(102, 240, 215, 0.38);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(20, 140, 128, 0.18);
  font-weight: 900;
  min-height: 42px;
  padding: 0 14px;
}

.collab-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.collab-tabs button {
  min-height: 36px;
  border: 1px solid rgba(151, 177, 207, 0.18);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 900;
  padding: 0 12px;
}

.collab-tabs button.is-active {
  border-color: rgba(102, 240, 215, 0.42);
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(102, 240, 215, 0.2), rgba(114, 232, 255, 0.08)),
    rgba(20, 140, 128, 0.16);
}

.collab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.collab-card,
.poll-form,
.collab-disagreement {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(118, 230, 255, 0.14);
  border-radius: var(--radius);
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.032)),
    rgba(255, 255, 255, 0.035);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.collab-card textarea,
.poll-form input,
.poll-form select,
.poll-form textarea,
.collab-card input,
.collab-disagreement textarea,
.collab-disagreement input {
  min-width: 0;
  border: 1px solid rgba(151, 177, 207, 0.18);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(0, 0, 0, 0.2);
  padding: 10px;
  outline: none;
}

.collab-card textarea,
.poll-form textarea,
.collab-disagreement textarea {
  min-height: 92px;
  resize: vertical;
}

.inline-check {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 850;
}

.inline-check input {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}

.target-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mini-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(118, 230, 255, 0.14);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.78rem;
  font-weight: 850;
}

.mini-check input {
  accent-color: var(--teal);
}

.field-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.collab-card button.danger {
  border-color: rgba(255, 117, 148, 0.42);
  background: rgba(144, 28, 57, 0.22);
}

.note-card.private {
  border-color: rgba(255, 204, 102, 0.3);
}

.poll-option {
  display: grid;
  justify-items: start;
  gap: 4px;
  width: 100%;
  text-align: left;
}

.poll-option small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.poll-card button {
  justify-self: stretch;
}

.astra-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.pulse-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 22px rgba(102, 240, 215, 0.72);
}

.signal-card {
  border: 1px solid rgba(118, 230, 255, 0.14);
  border-radius: var(--radius);
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.034)),
    rgba(255, 255, 255, 0.035);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
}

.signal-card strong {
  display: block;
  margin-top: 7px;
  overflow-wrap: anywhere;
}

.location-card,
.babyphone-card,
.calendar-card {
  grid-column: 1 / -1;
  border: 1px solid rgba(118, 230, 255, 0.14);
  border-radius: var(--radius);
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.034)),
    rgba(255, 255, 255, 0.035);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
}

.calendar-card,
.babyphone-card {
  display: grid;
  gap: 10px;
}

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

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

.babyphone-head strong {
  display: block;
  margin-top: 7px;
}

.babyphone-head button {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(102, 240, 215, 0.36);
  border-radius: var(--radius);
  color: var(--teal);
  background: rgba(20, 140, 128, 0.2);
  font-weight: 950;
}

.babyphone-head > div:last-child {
  display: inline-flex;
  gap: 8px;
}

.babyphone-snapshot {
  min-height: 120px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(118, 230, 255, 0.14);
  border-radius: var(--radius);
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(102, 240, 215, 0.08), transparent 52%),
    rgba(0, 0, 0, 0.24);
  font-size: 0.82rem;
  text-align: center;
}

.babyphone-snapshot img {
  width: 100%;
  max-height: 220px;
  display: block;
  object-fit: cover;
}

.babyphone-snapshot {
  cursor: zoom-in;
}

.babyphone-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 18px;
  background: rgba(0, 6, 16, 0.94);
  backdrop-filter: blur(10px);
}

.babyphone-modal-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(118, 230, 255, 0.22);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: rgba(8, 18, 34, 0.88);
}

.babyphone-modal-head span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
}

.babyphone-modal-head button {
  min-height: 40px;
  border: 1px solid rgba(102, 240, 215, 0.36);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(20, 140, 128, 0.24);
  font-weight: 900;
}

.babyphone-modal-image {
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(118, 230, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.36);
  color: var(--muted);
}

.babyphone-modal-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.babyphone-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.babyphone-fact {
  min-width: 0;
  border: 1px solid rgba(118, 230, 255, 0.12);
  border-radius: var(--radius);
  padding: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.babyphone-fact.warning {
  border-color: rgba(248, 200, 109, 0.38);
}

.babyphone-fact.error {
  border-color: rgba(255, 123, 156, 0.42);
}

.babyphone-fact strong {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.babyphone-status {
  min-height: 17px;
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.calendar-head strong {
  display: block;
  margin-top: 7px;
}

.calendar-head a {
  min-width: 48px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid rgba(102, 240, 215, 0.36);
  border-radius: var(--radius);
  color: var(--teal);
  text-decoration: none;
  font-weight: 950;
  background: rgba(20, 140, 128, 0.15);
}

.calendar-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.calendar-form button,
.location-actions button {
  padding: 0 12px;
  line-height: 1.1;
}

.location-actions button span {
  overflow-wrap: normal;
  text-wrap: balance;
}

.location-actions button .icon {
  flex: 0 0 auto;
}

.location-actions .location-check {
  white-space: nowrap;
}

.location-actions button,
.calendar-form button,
.calendar-head a {
  justify-content: center;
}

.calendar-form input {
  min-width: 0;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 13px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.24);
}

.calendar-list {
  display: grid;
  gap: 8px;
}

.calendar-item,
.calendar-empty {
  margin: 0;
  border: 1px solid rgba(118, 230, 255, 0.12);
  border-radius: var(--radius);
  padding: 9px;
  background: rgba(0, 0, 0, 0.18);
}

.calendar-item strong,
.calendar-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-status {
  min-height: 17px;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

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

.location-head strong {
  display: block;
  margin-top: 7px;
}

.location-head button,
.location-actions button {
  min-height: 46px;
  border: 1px solid rgba(102, 240, 215, 0.36);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(20, 140, 128, 0.2);
  font-weight: 900;
}

.location-head button {
  min-width: 58px;
  color: #ffd1dc;
  border-color: rgba(255, 123, 156, 0.42);
  background: rgba(95, 18, 40, 0.24);
}

.location-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 8px;
  margin-top: 12px;
}

.location-check {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(118, 230, 255, 0.16);
  border-radius: var(--radius);
  padding: 0 9px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--muted);
  font-weight: 900;
}

.location-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.location-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.location-item,
.location-empty {
  margin: 0;
  border: 1px solid rgba(118, 230, 255, 0.12);
  border-radius: var(--radius);
  padding: 9px;
  background: rgba(0, 0, 0, 0.18);
}

.location-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
}

.location-item strong,
.location-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-item span {
  grid-column: 1;
}

.location-item a {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  color: var(--teal);
  font-weight: 900;
  text-decoration: none;
}

.location-help {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.geo-dashboard {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 14px;
  padding: 18px;
}

.geo-toolbar,
.geo-map-wrap,
.geo-tabs,
.geo-row,
.geo-zone-form {
  display: flex;
  gap: 10px;
}

.geo-toolbar {
  align-items: center;
  justify-content: space-between;
}

.geo-toolbar span,
.geo-small-title {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
}

.geo-toolbar strong {
  color: var(--text);
  font-size: 1.1rem;
}

.geo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.geo-actions button,
.geo-tabs button,
.geo-row button,
.geo-zone-form button {
  background: rgba(95, 242, 221, 0.12);
  border: 1px solid rgba(95, 242, 221, 0.38);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  min-height: 40px;
  padding: 0 14px;
}

.geo-map-wrap {
  align-items: stretch;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
}

.geo-map {
  aspect-ratio: 16 / 8;
  background:
    linear-gradient(rgba(95, 242, 221, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(95, 242, 221, 0.08) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(95, 242, 221, 0.16), rgba(9, 20, 35, 0.94) 62%);
  background-size: 44px 44px, 44px 44px, 100% 100%;
  border: 1px solid rgba(95, 242, 221, 0.25);
  border-radius: 8px;
  min-height: 280px;
  overflow: hidden;
  position: relative;
}

.geo-map-empty {
  color: var(--muted);
  font-weight: 800;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.geo-marker,
.geo-zone-marker {
  position: absolute;
  transform: translate(-50%, -50%);
}

.geo-marker {
  align-items: center;
  background: #5ff2dd;
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  box-shadow: 0 0 30px rgba(95, 242, 221, 0.5);
  color: #041019;
  display: inline-flex;
  font-weight: 1000;
  height: 42px;
  justify-content: center;
  text-decoration: none;
  width: 42px;
}

.geo-marker.mine {
  background: #ffd166;
}

.geo-zone-marker {
  border: 1px dashed rgba(255, 209, 102, 0.8);
  border-radius: 999px;
  color: #ffd166;
  font-size: 0.75rem;
  font-weight: 900;
  min-height: 74px;
  min-width: 74px;
  padding-top: 78px;
  text-align: center;
}

.geo-side,
.geo-panel {
  background: rgba(16, 28, 45, 0.78);
  border: 1px solid rgba(151, 177, 207, 0.18);
  border-radius: 8px;
  padding: 12px;
}

.geo-side {
  display: grid;
  gap: 12px;
}

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

.geo-side label {
  color: var(--muted);
  display: grid;
  font-size: 0.78rem;
  font-weight: 800;
  gap: 6px;
}

.geo-side input,
.geo-zone-form input {
  background: rgba(6, 16, 30, 0.9);
  border: 1px solid rgba(151, 177, 207, 0.2);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  min-height: 42px;
  padding: 0 12px;
}

.geo-share-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.geo-share-choice {
  align-items: center;
  border: 1px solid rgba(151, 177, 207, 0.18);
  border-radius: 8px;
  display: inline-flex !important;
  gap: 7px !important;
  min-height: 34px;
  padding: 0 10px;
}

.geo-tabs {
  border-bottom: 1px solid rgba(151, 177, 207, 0.18);
}

.geo-tabs button {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.geo-tabs button.is-active {
  background: rgba(95, 242, 221, 0.14);
  border-color: rgba(95, 242, 221, 0.35);
  color: var(--text);
}

.geo-panel {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
}

.geo-row {
  align-items: center;
  background: rgba(6, 16, 30, 0.7);
  border: 1px solid rgba(151, 177, 207, 0.14);
  border-radius: 8px;
  justify-content: space-between;
  padding: 12px;
}

.geo-row div,
.geo-row {
  min-width: 0;
}

.geo-row strong,
.geo-row span {
  display: block;
}

.geo-row span {
  color: var(--muted);
  font-size: 0.84rem;
  margin-top: 4px;
}

.geo-row a {
  color: var(--teal);
  font-weight: 900;
  text-decoration: none;
}

.geo-zone-form {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 0.8fr auto;
}

.geo-empty {
  color: var(--muted);
  font-weight: 800;
  margin: 0;
}

@media (max-width: 1060px) {
  .chat-layout {
    height: auto;
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .astra-panel {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 10px 10px 84px;
  }

  .chat-layout {
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .geo-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .geo-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .geo-map-wrap {
    grid-template-columns: 1fr;
  }

  .geo-map {
    aspect-ratio: 1 / 1;
    min-height: 260px;
  }

  .geo-zone-form {
    grid-template-columns: 1fr;
  }

  .geo-row {
    align-items: stretch;
    flex-direction: column;
  }

  .message-deck {
    order: 1;
    min-height: calc(100dvh - 94px);
  }

  .room-rail {
    order: 2;
  }

  .astra-panel {
    order: 3;
  }

  body[data-mobile-panel="chat"] .room-rail,
  body[data-mobile-panel="chat"] .astra-panel,
  body[data-mobile-panel="rooms"] .message-deck,
  body[data-mobile-panel="rooms"] .astra-panel,
  body[data-mobile-panel="modules"] .room-rail,
  body[data-mobile-panel="modules"] .astra-panel,
  body[data-mobile-panel="profile"] .room-rail,
  body[data-mobile-panel="profile"] .message-deck {
    display: none;
  }

  body[data-mobile-panel="rooms"] .room-rail,
  body[data-mobile-panel="profile"] .astra-panel {
    display: grid;
    min-height: calc(100dvh - 94px);
  }

  body[data-mobile-panel="modules"] .message-deck {
    display: grid;
    min-height: calc(100dvh - 94px);
  }

  .deck-head {
    min-height: 64px;
    padding: 10px 12px;
  }

  .deck-head h2 {
    font-size: 1.18rem;
  }

  .deck-actions button {
    width: 38px;
    height: 38px;
    padding: 0;
  }

  .message-list {
    padding: 12px;
  }

  .message {
    width: 96%;
    grid-template-columns: 32px minmax(0, 1fr);
    padding: 10px;
  }

  .message-avatar {
    width: 32px;
    height: 32px;
  }

  .message-map {
    grid-template-columns: 1fr;
  }

  .message-map-visual {
    min-height: 126px;
  }

  .message-map-text {
    padding: 0 12px 12px;
  }

  .room-rail {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .room-group-title {
    grid-column: 1 / -1;
  }

  .astra-panel {
    grid-template-columns: 1fr 1fr;
  }

  .location-card {
    grid-column: 1 / -1;
  }

  .calendar-card {
    grid-column: 1 / -1;
  }

  .composer {
    grid-template-columns: minmax(0, 1fr) 48px 48px;
    padding: 10px;
  }

  .composer textarea {
    grid-column: auto;
    min-height: 48px;
  }

  .composer button {
    width: 100%;
    min-width: 0;
    min-height: 48px;
  }

  .composer-action-menu {
    right: 10px;
    bottom: 70px;
    grid-template-columns: 1fr 1fr;
  }

  .mobile-dock {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    border: 1px solid rgba(118, 230, 255, 0.2);
    border-radius: var(--radius);
    padding: 8px;
    background:
      linear-gradient(180deg, rgba(12, 26, 45, 0.96), rgba(4, 10, 20, 0.96)),
      var(--panel);
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.5);
  }

  .mobile-dock button {
    min-width: 0;
    min-height: 50px;
    display: grid;
    place-items: center;
    gap: 3px;
    border: 1px solid rgba(118, 230, 255, 0.18);
    border-radius: var(--radius);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.72rem;
    font-weight: 900;
  }

  .mobile-dock button.is-active {
    color: #031014;
    border-color: rgba(255, 255, 255, 0.32);
    background: linear-gradient(135deg, var(--teal), var(--cyan));
  }

  .mobile-dock .icon {
    width: 19px;
    height: 19px;
  }
}
