/* NOMI messenger appearance: extra bubble themes, readable text shades and compact controls. */
#nomiMessenger[data-theme="emerald"] { --nomi-own: #1e6951; --nomi-other: #21453c; }
#nomiMessenger[data-theme="burgundy"] { --nomi-own: #7a304d; --nomi-other: #422639; }
#nomiMessenger[data-theme="teal"] { --nomi-own: #176879; --nomi-other: #234650; }
#nomiMessenger[data-theme="amber"] { --nomi-own: #765223; --nomi-other: #483620; }
#nomiMessenger[data-theme="plum"] { --nomi-own: #70458a; --nomi-other: #392847; }
#nomiMessenger[data-theme="graphite"] { --nomi-own: #48596d; --nomi-other: #293340; }

/* Only chat text, not time stamps, control labels, tool buttons, or image backgrounds. */
#nomiMessenger #nomiMessages .nomi-message-bubble {
  color: var(--nomi-chat-text, #f7f1ff);
}
#nomiMessenger #nomiMessages .nomi-message-bubble p,
#nomiMessenger #nomiMessages .nomi-message-bubble blockquote {
  color: inherit;
}
#nomiMessenger #nomiMessages .nomi-message-bubble a {
  text-decoration: underline;
}

/* Keep appearance inside the thread's foldable hamburger menu. */
#nomiMessenger .nomi-thread-menu {
  box-sizing: border-box;
  width: min(380px, 100%);
  max-width: 100%;
}
#nomiMessenger .nomi-chat-customizer {
  box-sizing: border-box;
  width: 100%;
  padding: 9px;
}
#nomiMessenger .nomi-chat-customizer summary {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}
#nomiMessenger .nomi-chat-style-controls {
  display: grid;
  grid-template-columns: minmax(70px, .95fr) minmax(105px, 1.3fr) minmax(65px, .75fr);
  gap: 8px;
  margin-top: 8px;
  align-items: end;
}
#nomiMessenger .nomi-chat-style-controls label {
  display: grid;
  flex: none;
  gap: 4px;
  min-width: 0;
  margin: 0;
  font-size: 12px;
  line-height: 1.3;
}
#nomiMessenger .nomi-chat-style-controls select {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 36px;
  padding: 5px 5px 5px 7px;
  font: inherit;
  font-size: 13px;
  text-overflow: ellipsis;
  border-radius: 9px;
}
#nomiMessenger .nomi-chat-style-controls select:focus-visible {
  outline: 2px solid #e7c0ff;
  outline-offset: 2px;
}
#nomiMessenger .nomi-chat-style-controls .nomi-chat-text-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(75px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding-top: 7px;
  border-top: 1px solid #503961;
}
#nomiMessenger .nomi-chat-text-row select {
  max-width: 100%;
}
@media (max-width: 390px) {
  #nomiMessenger .nomi-chat-customizer { padding: 8px; }
  #nomiMessenger .nomi-chat-style-controls { gap: 6px; }
  #nomiMessenger .nomi-chat-style-controls select { font-size: 12px; padding-inline: 5px; }
}

/* 21 Oct 2026: quoted messages are distinct from the reply body. */
#nomiMessenger #nomiMessages .nomi-message-bubble > blockquote {
  box-sizing: border-box;
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 0 8px;
  padding: 7px 9px;
  background: rgba(24, 30, 61, .72);
  border: 1px solid rgba(160, 217, 255, .25);
  border-left: 3px solid #81dcfa;
  border-radius: 9px;
  color: #dcf6ff !important;
  font-size: .91em;
  line-height: 1.38;
  font-family: inherit;
  font-weight: 500;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#nomiMessenger #nomiMessages .nomi-message.own .nomi-message-bubble > blockquote {
  background: rgba(24, 19, 56, .72);
  border-color: rgba(248, 212, 137, .27);
  border-left-color: #f5cf7c;
  color: #ffedbd !important;
}
#nomiMessenger #nomiMessages .nomi-message-bubble > blockquote + p {
  margin-top: 1px !important;
}

/* Rich message palette; every option keeps good contrast with pale text. */
#nomiMessenger[data-theme="sapphire"] { --nomi-own: #285f98; --nomi-other: #233d63; }
#nomiMessenger[data-theme="coral"]    { --nomi-own: #9f4d67; --nomi-other: #543346; }
#nomiMessenger[data-theme="indigo"]   { --nomi-own: #50539e; --nomi-other: #2e3057; }
#nomiMessenger[data-theme="forest"]   { --nomi-own: #226751; --nomi-other: #25483e; }
#nomiMessenger[data-theme="copper"]   { --nomi-own: #865237; --nomi-other: #493629; }

/* Optional slim message outlines; never draw framing around an image. */
#nomiMessenger #nomiMessages .nomi-message-bubble:not(.nomi-empty-media-bubble):not(.nomi-media-only):not(:has(> .nomi-chat-media)) {
  border: var(--nomi-chat-border-width, 0px) solid var(--nomi-chat-border-color, transparent);
}
/* Border chooser takes one extra compact row; no horizontal overflow on phones. */
#nomiMessenger .nomi-chat-style-controls .nomi-chat-border-color-row {
  grid-column: span 2;
}
#nomiMessenger .nomi-chat-style-controls .nomi-chat-border-size-row {
  grid-column: span 1;
}
@media (max-width: 340px) {
  #nomiMessenger .nomi-chat-style-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #nomiMessenger .nomi-chat-style-controls label:nth-child(3) {
    grid-column: 1 / -1;
  }
  #nomiMessenger .nomi-chat-style-controls .nomi-chat-border-color-row {
    grid-column: span 1;
  }
  #nomiMessenger .nomi-chat-style-controls .nomi-chat-border-size-row {
    grid-column: span 1;
  }
}
