/* Pure black & white theme. No color accents anywhere. */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #2a2a2a;
  background: #000;
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  display: inline-block;
}

.status {
  font-size: 12px;
  color: #aaa;
  border: 1px solid #333;
  padding: 4px 10px;
  border-radius: 999px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.bubble.user {
  align-self: flex-end;
  background: #fff;
  color: #000;
  border-bottom-right-radius: 4px;
}

.bubble.assistant {
  align-self: flex-start;
  background: #1a1a1a;
  color: #fff;
  border: 1px solid #2a2a2a;
  border-bottom-left-radius: 4px;
}

.bubble.narration {
  align-self: center;
  background: transparent;
  border: 1px solid #3a3420;
  color: #d9b45c;
  font-style: italic;
  font-size: 13px;
  text-align: center;
  max-width: 92%;
}

/* Inline narration within a normal dialogue bubble — the "different color
   text" the character's stage directions use vs her spoken dialogue. */
.narr-inline {
  color: #d9b45c;
  font-style: italic;
}

.dialogue {
  color: inherit;
}

.undress-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  width: 100%;
  background: #1a1a1a;
  border: 1px solid #3a3a3a;
  color: #fff;
  padding: 8px;
  border-radius: 10px;
  font-size: 13px;
}

.undress-btn svg, .edit-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.undress-btn:disabled {
  opacity: 0.5;
}

.bubble img {
  max-width: 100%;
  border-radius: 10px;
  display: block;
  margin-top: 4px;
}

.msg-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
  opacity: 0.75;
}

.version-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #555;
}

.version-nav button {
  background: none;
  border: none;
  color: #000;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}

.version-nav button:disabled {
  opacity: 0.25;
}

.edit-btn {
  background: none;
  border: none;
  font-size: 13px;
  padding: 0;
  cursor: pointer;
}

.edit-textarea {
  width: 100%;
  min-height: 60px;
  background: #fff;
  color: #000;
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 8px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
}

.edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.edit-cancel, .edit-save {
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
}

.edit-cancel {
  background: transparent;
  color: #666;
}

.edit-save {
  background: #000;
  color: #fff;
}

.typing {
  align-self: flex-start;
  color: #888;
  font-size: 13px;
  padding: 2px 10px;
}

.img-loading-wrap {
  position: relative;
  width: 220px;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 4px;
  background: linear-gradient(135deg, #1a1a1a, #333);
}

.img-blur {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(18px) brightness(0.7);
  transform: scale(1.1);
}

.img-placeholder-gradient {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a1a, #3a3a3a, #1a1a1a);
}

.img-loading-wrap .spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: natalia-spin 0.8s linear infinite;
}

@keyframes natalia-spin {
  to { transform: rotate(360deg); }
}

.composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid #2a2a2a;
  background: #000;
}

.composer input {
  flex: 1;
  background: #141414;
  border: 1px solid #2a2a2a;
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 15px;
  outline: none;
}

.composer input::placeholder { color: #777; }

.icon-btn {
  background: #141414;
  border: 1px solid #2a2a2a;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.icon-btn.send {
  background: #fff;
  color: #000;
}

.icon-btn:active { opacity: 0.6; }

.tray {
  padding: 12px 16px;
  border-top: 1px solid #2a2a2a;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: #050505;
}

.tray.hidden { display: none; }

.tray-btn {
  flex: 1;
  min-width: 90px;
  background: #141414;
  border: 1px solid #333;
  color: #fff;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  text-align: center;
}

.tray-btn.ghost {
  background: transparent;
  color: #888;
  border-color: #2a2a2a;
}

.pkg-btn {
  width: 100%;
  background: #141414;
  border: 1px solid #333;
  color: #fff;
  padding: 14px;
  border-radius: 12px;
  font-size: 14px;
  text-align: left;
  display: flex;
  justify-content: space-between;
}

.pkg-btn .tag {
  color: #aaa;
  font-size: 12px;
}

.empty-hint {
  color: #666;
  text-align: center;
  font-size: 13px;
  margin-top: 40px;
}
