/* The original composer remains the default, using the existing style.css. */
.message-form .composer-input-shell { display: contents; }
.message-form .composer-reference-icon { display: none; }
.message-form .composer-legacy-icon { pointer-events: none; }
.message-form[data-composer-theme="neon-space"] .composer-legacy-icon { display: none; }
/* Desktop composer: real controls over the supplied reference artwork.
   One reference unit is one pixel at the original 2172px panel width. */
.message-form[data-composer-theme="neon-space"] {
  --composer-surface: #02051b;
  container-type: inline-size;
  padding: 0;
  gap: 0;
  border: 0;
  background: var(--composer-surface);
  box-shadow: none;
  overflow: visible;
}

.message-form[data-composer-theme="neon-space"]::before,
.message-form[data-composer-theme="neon-space"]::after { content: none; }

.message-form[data-composer-theme="neon-space"] .composer-top-row {
  flex-basis: calc(100% - 18px);
  min-height: 18px;
  margin: 0 9px;
  padding: 1px 8px;
  box-sizing: border-box;
  border: 1px solid transparent;
  border-radius: 5px;
  background: linear-gradient(var(--composer-surface), var(--composer-surface)) padding-box,
    linear-gradient(90deg, #09bddf38, #3a386725 52%, #be44d93b) border-box;
}

.message-form[data-composer-theme="neon-space"] .typing-indicator {
  color: #a9d5fa;
  text-shadow: 0 0 6px #216ba9;
}

.message-form[data-composer-theme="neon-space"] .composer-controls {
  --cu: .46px;
  --orbit-bg: #030720;
  --orbit-stroke: linear-gradient(145deg, #00dcf4, #005ce5);
  position: relative;
  box-sizing: border-box;
  gap: calc(22 * var(--cu));
  min-height: calc(168 * var(--cu));
  padding: calc(27 * var(--cu)) calc(39 * var(--cu)) calc(27 * var(--cu)) calc(47 * var(--cu));
  border: 0;
  border-radius: 0;
  background: var(--composer-surface);
  box-shadow: none;
  backdrop-filter: none;
  isolation: isolate;
}

/* Nine-slice framing keeps the corner cuts intact when a draft grows. */
.message-form[data-composer-theme="neon-space"] .composer-controls::before {
  content: "";
  position: absolute;
  inset: 0;
  border: solid transparent;
  border-width: calc(50 * var(--cu));
  border-image: url("assets/composer/frame.svg") 50 / calc(50 * var(--cu)) stretch;
  pointer-events: none;
  z-index: -1;
}

.message-form[data-composer-theme="neon-space"] .composer-orbit {
  box-sizing: border-box;
  flex: 0 0 auto;
  width: calc(79 * var(--cu));
  height: calc(79 * var(--cu));
  min-width: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: calc(2 * var(--cu)) solid transparent;
  border-radius: 50%;
  background: linear-gradient(var(--orbit-bg), var(--orbit-bg)) padding-box,
    var(--orbit-stroke) border-box;
  color: #a0edff;
  text-shadow: none;
  box-shadow: 0 0 calc(14 * var(--cu)) #0088e532,
    inset 0 0 calc(18 * var(--cu)) #003d7130;
  animation: none;
  cursor: pointer;
  transition: filter .15s ease, transform .15s ease;
}

.message-form[data-composer-theme="neon-space"] .composer-icon {
  display: block;
  width: calc(38 * var(--cu));
  height: calc(42 * var(--cu));
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.message-form[data-composer-theme="neon-space"] .composer-icon-clip {
  width: calc(31 * var(--cu));
  height: calc(40 * var(--cu));
  filter: drop-shadow(0 0 3px #00b9ee);
}

.message-form[data-composer-theme="neon-space"] .emoji-button {
  --orbit-stroke: linear-gradient(140deg, #f4d764, #a12fe0 65%, #c811d9);
  box-shadow: 0 0 calc(12 * var(--cu)) #9f24e729;
}

.message-form[data-composer-theme="neon-space"] .composer-icon-emoji {
  width: calc(39 * var(--cu));
  height: calc(39 * var(--cu));
  stroke: none;
}

.message-form[data-composer-theme="neon-space"] .clear-message-button {
  --orbit-stroke: linear-gradient(140deg, #bf4beb, #7e13d3);
  width: calc(69 * var(--cu));
  height: calc(70 * var(--cu));
  margin-right: calc(7 * var(--cu));
  color: #ec60e5;
  box-shadow: none;
}

.message-form[data-composer-theme="neon-space"] .composer-icon-clear {
  width: calc(33 * var(--cu));
  height: calc(33 * var(--cu));
  stroke-width: 3.7;
}

.message-form[data-composer-theme="neon-space"] .composer-input-shell {
  display: block;
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  border: calc(2 * var(--cu)) solid transparent;
  border-radius: calc(40 * var(--cu));
  background: linear-gradient(#070d2b, #070d2b) padding-box,
    linear-gradient(115deg, #00def5, #5850e8 54%, #e13de5) border-box;
  overflow: hidden;
  isolation: isolate;
}

/* Continued space artwork covers the complete system-controlled draft height. */
.message-form[data-composer-theme="neon-space"] .composer-input-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #070d2b60, #070d2b18 70%),
    url("assets/composer/wallpaper-extension.png") right bottom / cover no-repeat;
  pointer-events: none;
  z-index: -1;
}

/* Preserve the supplied planet at the bottom and feather its texture into
   the continued starfield; no hard one-line artwork boundary remains. */
.message-form[data-composer-theme="neon-space"] .composer-input-shell::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: auto;
  width: min(100%, calc(1573 * var(--cu)));
  height: calc(110 * var(--cu));
  background-image: linear-gradient(90deg, #060c29 0%, #070e2d 39%, #070d2bd9 47%, transparent 67%),
    url("assets/composer/reference.png");
  background-size: 100% 100%, calc(2172 * var(--cu)) calc(724 * var(--cu));
  background-position: center, right calc(-252 * var(--cu)) top calc(-304 * var(--cu));
  background-repeat: no-repeat;
  mask-image: linear-gradient(90deg, transparent, #000 calc(12 * var(--cu)), #000 calc(100% - 12 * var(--cu)), transparent),
    linear-gradient(0deg, transparent, #000 calc(6 * var(--cu)), #000 calc(100% - 32 * var(--cu)), transparent);
  mask-composite: intersect;
  pointer-events: none;
  z-index: -1;
}

.message-form[data-composer-theme="neon-space"] .composer-input-shell textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: calc(110 * var(--cu));
  max-height: clamp(162px, 42dvh, 360px);
  margin: 0;
  padding: calc(32 * var(--cu)) calc(43 * var(--cu));
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: #e5e9ff;
  caret-color: #79e7ff;
  font-family: Arial, sans-serif;
  font-size: calc(36 * var(--cu));
  font-weight: 400;
  line-height: calc(46 * var(--cu));
  box-shadow: none;
}

.message-form[data-composer-theme="neon-space"] .composer-input-shell textarea::placeholder { color: #999bad; opacity: 1; white-space: pre; }
.message-form[data-composer-theme="neon-space"] .composer-input-shell textarea:placeholder-shown { white-space: pre; overflow-x: hidden; }
.message-form[data-composer-theme="neon-space"] .composer-input-shell textarea:focus { background: transparent; box-shadow: none; }
.message-form[data-composer-theme="neon-space"] .composer-input-shell:focus-within { box-shadow: 0 0 0 2px #72e5ff55; }

.message-form[data-composer-theme="neon-space"] .composer-mode-toggle {
  --orbit-stroke: linear-gradient(145deg, #3689ff, #5d2de7);
  width: calc(60 * var(--cu));
  height: calc(60 * var(--cu));
  margin-left: calc(6 * var(--cu));
  color: #edf2ff;
}

.message-form[data-composer-theme="neon-space"] .composer-mode-toggle-icon { font-size: 0; text-shadow: none; }
.message-form[data-composer-theme="neon-space"] .composer-icon-sparkles {
  width: calc(32 * var(--cu));
  height: calc(32 * var(--cu));
  fill: currentColor;
  stroke: none;
  filter: drop-shadow(0 0 4px #6963fa);
}

.message-form[data-composer-theme="neon-space"] .composer-mode-toggle.is-active {
  --orbit-stroke: linear-gradient(145deg, #7ef1ff, #8b68ff);
  --orbit-bg: #182758;
  color: #b9f7ff;
  background: linear-gradient(var(--orbit-bg), var(--orbit-bg)) padding-box,
    var(--orbit-stroke) border-box;
  box-shadow: 0 0 calc(14 * var(--cu)) #6278ff66;
}

/* Send, voice and video share one size, material and action slot. */
.message-form[data-composer-theme="neon-space"] :is(.send-button, .voice-record-button) {
  box-sizing: border-box;
  flex: 0 0 auto;
  width: calc(103 * var(--cu));
  height: calc(103 * var(--cu));
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(155deg, #63dbff 0%, #369aff 49%, #793cff 100%);
  color: #051233;
  box-shadow: inset 0 calc(2 * var(--cu)) calc(4 * var(--cu)) #c4f4ff,
    inset 0 calc(-3 * var(--cu)) calc(6 * var(--cu)) #9c48fa88,
    0 0 calc(22 * var(--cu)) #6345ff70;
  text-shadow: none;
  transition: filter .15s ease, transform .15s ease;
}

.message-form[data-composer-theme="neon-space"] .send-button { font-size: 0; }
.message-form[data-composer-theme="neon-space"] .send-button::after {
  content: "";
  width: calc(39 * var(--cu));
  height: calc(39 * var(--cu));
  background: currentColor;
  clip-path: polygon(10% 11%, 95% 50%, 10% 89%, 29% 56%, 59% 50%, 29% 44%);
}
.message-form[data-composer-theme="neon-space"] .send-button.is-save-mode::after {
  clip-path: polygon(5% 48%, 17% 36%, 40% 59%, 83% 14%, 96% 27%, 40% 85%);
}
.message-form[data-composer-theme="neon-space"]:is(.is-submitting, .is-uploading) .send-button::after,
.message-form[data-composer-theme="neon-space"] .send-button.is-uploading::after {
  clip-path: polygon(20% 8%, 80% 8%, 80% 22%, 57% 48%, 57% 54%, 80% 80%, 80% 94%, 20% 94%, 20% 80%, 43% 54%, 43% 48%, 20% 22%);
}
.message-form[data-composer-theme="neon-space"] .voice-record-button .recorder-mode-icon-voice {
  width: calc(38 * var(--cu));
  height: calc(46 * var(--cu));
  stroke-width: 2.8;
}
.message-form[data-composer-theme="neon-space"] .voice-record-button .recorder-mode-icon-video {
  width: calc(43 * var(--cu));
  height: calc(43 * var(--cu));
}
.message-form[data-composer-theme="neon-space"] .voice-record-button.is-video-mode .recorder-mode-icon-voice { display: none; }

.message-form[data-composer-theme="neon-space"] .composer-controls :is(.composer-orbit, .send-button, .voice-record-button):not(:disabled):hover {
  filter: brightness(1.13);
  transform: translateY(-1px);
  animation: none;
}
.message-form[data-composer-theme="neon-space"] .composer-controls .composer-orbit:not(:disabled):hover {
  background: linear-gradient(var(--orbit-bg), var(--orbit-bg)) padding-box,
    var(--orbit-stroke) border-box;
  box-shadow: 0 0 calc(16 * var(--cu)) #725aff66;
}
.message-form[data-composer-theme="neon-space"] .composer-controls :is(.send-button, .voice-record-button):not(:disabled):hover {
  background: linear-gradient(155deg, #63dbff 0%, #369aff 49%, #793cff 100%);
  box-shadow: inset 0 calc(2 * var(--cu)) calc(4 * var(--cu)) #c4f4ff,
    inset 0 calc(-3 * var(--cu)) calc(6 * var(--cu)) #9c48fa88,
    0 0 calc(22 * var(--cu)) #6345ff70;
}
.message-form[data-composer-theme="neon-space"] .composer-controls :is(.composer-orbit, .send-button, .voice-record-button):not(:disabled):active {
  transform: scale(.96);
}
.message-form[data-composer-theme="neon-space"] .composer-controls button:focus-visible {
  outline: 2px solid #b4ecff;
  outline-offset: 3px;
}
.message-form[data-composer-theme="neon-space"] .composer-controls button:disabled { opacity: .5; cursor: default; }
.message-form[data-composer-theme="neon-space"] .voice-recording-panel { background: #100d2b; border-color: #e25be580; }
.message-form[data-composer-theme="neon-space"].is-editing { box-shadow: none; }

@media (max-width: 600px) {
  .message-form[data-composer-theme="neon-space"] .composer-controls {
    --cu: .46px;
    gap: 6px;
    padding-right: 12px;
    padding-left: 14px;
  }
  .message-form[data-composer-theme="neon-space"] .clear-message-button { margin-right: 0; }
  .message-form[data-composer-theme="neon-space"] .composer-mode-toggle { margin-left: 0; }
  .message-form[data-composer-theme="neon-space"] .composer-input-shell textarea { padding-right: 10px; padding-left: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .message-form[data-composer-theme="neon-space"] .composer-controls button { transition: none; }
  .message-form[data-composer-theme="neon-space"] .typing-indicator::after,
  .message-form[data-composer-theme="neon-space"] .upload-indicator-dot,
  .message-form[data-composer-theme="neon-space"] .voice-recording-dot { animation: none; }
}
