*, 
*::before, 
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #111111;
  --panel: #1c1c1c;
  --panel-soft: #181818;
  --accent: #f5a623;
  --accent-soft: rgba(245, 166, 35, 0.14);
  /* UI accent family (overridden per-thread in light mode) */
  --accent-ui: #262626;
  --accent-ui-soft: #303030;
  --accent-ui-strong: #f5a623;
  --text: #f5f5f5;
  --muted: #888888;
  --border: #2b2b2b;
  --radius: 10px;
  --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.45);
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
}

body.light-mode {
  color-scheme: light;
  --bg: #f4f4f4;
  --panel: #ffffff;
  --panel-soft: #f8f8f8;
  --accent: #f5a623;
  --accent-soft: rgba(245, 166, 35, 0.16);
  /* Default light-mode UI accent; can be overridden per-thread */
  --accent-ui: #f5a623;
  --accent-ui-soft: rgba(245, 166, 35, 0.08);
  --accent-ui-strong: #e38c05;
  --text: #202020;
  --muted: #777777;
  --border: #d0d0d0;
  --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.08);
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: radial-gradient(circle at top, #202020 0, #111111 55%, #060606 100%);
  font-family: var(--font-main);
  color: var(--text);
}

body.light-mode {
  background: radial-gradient(circle at top, #ffffff 0, #f4f4f4 55%, #e6e6e6 100%);
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

#app {
  width: 100vw;
  height: 100vh;
  max-width: 430px;
  max-height: 932px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

#app.thread-has-background .chat-panel {
  background: rgba(0, 0, 0, 0.35);
}

#app.thread-has-background-light .chat-panel {
  background: rgba(255, 255, 255, 0.75);
}

.top-panel,
.bottom-panel {
  background: rgba(12, 12, 12, 0.8);
  border-radius: 16px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px);
}

.top-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.top-panel.hidden {
  display: none;
}

.chat-panel {
  flex: 1;
  min-height: 0;
  background: rgba(10, 10, 10, 0.85);
  border-radius: 16px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  position: relative;
}

.chat-panel-background {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.chat-panel-background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(3px) brightness(0.6);
}

body.light-mode .chat-panel-background img {
  filter: blur(3px) brightness(0.9);
}

.chat-panel-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#customWritingStyleGroup textarea {
  font-size: 12px;
}

label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.mini-btn {
  border: none;
  border-radius: 999px;
  padding: 0 10px;
  min-height: 24px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text);
  background: #262626;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.08s ease, box-shadow 0.18s ease,
    color 0.18s ease;
  white-space: nowrap;
}

.mini-btn:active {
  transform: translateY(1px) scale(0.99);
}

input,
textarea {
  background: var(--panel-soft);
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 9px;
  resize: none;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease,
    background-color 0.18s ease;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
  background: #202020;
}

body.light-mode input:focus,
body.light-mode textarea:focus {
  color: #ffffff;
  background: #202020;
}

input::placeholder,
textarea::placeholder {
  color: #555;
}

.ref-images-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 90px;
  overflow-y: auto;
  padding-right: 2px;
}

.lorebooks-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 90px;
  overflow-y: auto;
  padding-right: 2px;
  font-size: 11px;
}

.lorebook-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 8px;
  background: #151515;
  border: 1px solid #262626;
}

.lorebook-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lorebook-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lorebook-toggle-label {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--muted);
}

.lorebook-remove {
  border: none;
  background: transparent;
  color: #ff6b6b;
  font-size: 11px;
  cursor: pointer;
}

.ref-image-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 4px;
  border-radius: 8px;
  background: #151515;
  border: 1px solid #262626;
}

.ref-image-thumb-wrapper {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}

.ref-image-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ref-image-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ref-image-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.ref-image-name {
  font-size: 11px;
  color: #e0e0e0;
}

.ref-image-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.ref-image-checkbox {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  color: var(--muted);
}

.ref-image-remove {
  border: none;
  background: transparent;
  color: #ff6b6b;
  font-size: 11px;
  padding: 0 4px;
  cursor: pointer;
}

.ref-image-notes {
  width: 100%;
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid #262626;
  background: #101010;
  color: var(--text);
  resize: vertical;
}

#chatHistory {
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.message-row.user {
  justify-content: flex-end;
}

.message-avatar {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.25);
  background: #222;
}

body.light-mode .message-avatar {
  border-color: rgba(0, 0, 0, 0.08);
  background: #f0f0f0;
}

.message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-bubble-wrapper {
  max-width: 100%;
}

#chatHistory::-webkit-scrollbar {
  width: 4px;
}
#chatHistory::-webkit-scrollbar-track {
  background: transparent;
}
#chatHistory::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 999px;
}

.message {
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #f5a623, #f76b1c);
  color: #000;
  border-bottom-right-radius: 4px;
}

body.light-mode .message.user {
  box-shadow: 0 4px 10px rgba(247, 107, 28, 0.35);
}

.message.ai {
  align-self: flex-start;
  background: #1b1b1b;
  border-left: 2px solid var(--accent-soft);
  border-bottom-left-radius: 4px;
}

body.light-mode .message.ai {
  background: #ffffff;
  border-left-color: var(--accent-soft);
}

.message.system {
  align-self: center;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}

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

.message-image-thumb {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid #333;
}

.message-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.message-actions-row {
  margin-top: 4px;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.message-rerun-btn {
  min-height: 22px;
  padding: 0 8px;
  font-size: 10px;
  border-radius: 999px;
  border: 1px solid #333;
  background: #242424;
  color: #ddd;
  cursor: pointer;
}

body.light-mode .message-rerun-btn {
  background: #f0f0f0;
  color: #222;
  border-color: #d0d0d0;
}

.message-like-btn,
.message-dislike-btn {
  font-size: 14px;
  padding: 0 6px;
}

.message-like-btn:hover {
  background: #2a4a2a;
}

.message-dislike-btn:hover {
  background: #4a2a2a;
}

body.light-mode .message-like-btn:hover {
  background: #d0f0d0;
}

body.light-mode .message-dislike-btn:hover {
  background: #f0d0d0;
}

.message-rerun-nav-btn {
  min-width: 24px;
  padding: 0 6px;
}

.message-rerun-indicator {
  font-size: 10px;
  color: var(--muted);
  align-self: center;
}

.message-editor {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 12px;
  background: #161616;
  border: 1px solid #2b2b2b;
  font-size: 12px;
}

.message-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.message-role-select {
  flex: 1;
  min-height: 26px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #101010;
  color: var(--text);
  font-size: 11px;
  padding: 2px 8px;
}

.message-editor-actions {
  display: flex;
  gap: 4px;
}

.message-editor-btn {
  min-height: 24px;
  padding: 0 8px;
  font-size: 10px;
  border-radius: 999px;
  border: 1px solid #333;
  background: #242424;
  color: #ddd;
  cursor: pointer;
}

.message-editor-btn.danger {
  color: #ff6b6b;
  border-color: #552222;
}

.message-editor-btn.pin-active {
  color: var(--accent);
  border-color: var(--accent-soft);
  background: #302313;
}

.message-editor textarea {
  width: 100%;
  min-height: 40px;
  font-size: 12px;
  padding: 6px 7px;
  resize: vertical;
}

.bottom-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-row {
  display: flex;
  gap: 6px;
}

#userInput {
  flex: 1;
}

.input-side-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#attachImageBtn {
  min-height: 18px;
  padding: 0 10px;
  font-size: 14px;
  background: #262626;
}

.attached-image-preview {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 0;
  margin-top: -2px;
  font-size: 11px;
  color: var(--muted);
}

.hidden-instruction-container {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hidden-instruction-label {
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.9;
}

#hiddenInstructionInput {
  background: #22161c;
  border-color: #4a2830;
  font-size: 11px;
}

body.light-mode #hiddenInstructionInput {
  background: #fceae9;
  border-color: #f3b4b4;
}

.attached-image-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #333;
}

.attached-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attached-image-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.attached-image-name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attached-image-remove-btn {
  border: none;
  background: transparent;
  color: #ff6b6b;
  font-size: 11px;
  cursor: pointer;
}

button {
  border: none;
  border-radius: 999px;
  padding: 0 14px;
  min-height: 40px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: #262626;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.08s ease, box-shadow 0.18s ease,
    color 0.18s ease;
  white-space: nowrap;
}

/* In light mode, let the accent UI color drive the controls */
body.light-mode button {
  background: var(--accent-ui);
  color: #000;
  border: 1px solid var(--accent-ui-strong);
}

body.light-mode button:disabled {
  border-color: rgba(0, 0, 0, 0.06);
}


button:active {
  transform: translateY(1px) scale(0.99);
}

button:disabled {
  opacity: 0.7;
  cursor: default;
  box-shadow: none;
}

#sendBtn {
  background: linear-gradient(135deg, #f5a623, #f76b1c);
  color: #000;
  box-shadow: 0 8px 18px rgba(247, 107, 28, 0.4);
}

#sendBtn:active {
  box-shadow: 0 4px 10px rgba(247, 107, 28, 0.35);
}

.controls-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
}

.ai-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-setting {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 30%;
}

.ai-setting label {
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.ai-setting input,
.ai-setting select {
  width: 100%;
  min-height: 26px;
  font-size: 12px;
  padding: 4px 6px;
}

.thread-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

#groupChatConfigBtn {
  min-height: 30px;
  padding: 0 8px;
  font-size: 16px;
  background: #1d1d1d;
  color: #ddd;
}

.right-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

#threadSelect {
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #151515;
  color: var(--text);
  font-size: 11px;
  padding: 0 10px;
  max-width: 150px;
}

#unfilteredModeBtn,
#exportJsonBtn,
#exportCurrentThreadBtn,
#importBtn,
#importMergeBtn {
  min-height: 34px;
  padding: 0 10px;
  font-size: 11px;
  background: #1d1d1d;
  color: #ddd;
}

#unfilteredModeBtn.unfiltered-active {
  background: linear-gradient(135deg, #c0392b, #e67e22);
  color: #000;
  box-shadow: 0 0 0 1px rgba(230, 126, 34, 0.5);
}

body.light-mode #exportJsonBtn,
body.light-mode #importBtn {
  background: var(--accent-ui);
  color: #000;
  border: 1px solid var(--accent-ui-strong);
}

#newChatBtn,
#duplicateThreadBtn,
#renameThreadBtn,
#importCharCardBtn {
  min-height: 30px;
  padding: 0 10px;
  font-size: 10px;
  background: #1d1d1d;
  color: #ddd;
}

#deleteThreadBtn {
  min-height: 30px;
  padding: 0 10px;
  font-size: 10px;
  background: #3a1818;
  color: #ffb4b4;
}

body.light-mode #newChatBtn,
body.light-mode #duplicateThreadBtn,
body.light-mode #renameThreadBtn,
body.light-mode #importCharCardBtn {
  background: var(--accent-ui);
  color: #000;
  border: 1px solid var(--accent-ui-strong);
}

body.light-mode #deleteThreadBtn {
  background: #ffe5e5;
  color: #bb0000;
  border: 1px solid #f5c4c4;
}

#editModeBtn {
  min-height: 34px;
  padding: 0 10px;
  font-size: 11px;
  background: #1d1d1d;
  color: #ddd;
}

#themeToggleBtn {
  min-height: 34px;
  padding: 0 10px;
  font-size: 11px;
  background: #1d1d1d;
  color: #ddd;
}

#autoReplyToggleBtn {
  min-height: 34px;
  padding: 0 10px;
  font-size: 11px;
  background: #1d1d1d;
  color: #ddd;
}

#ttsToggleBtn {
  min-height: 34px;
  padding: 0 10px;
  font-size: 11px;
  background: #1d1d1d;
  color: #ddd;
}

body.light-mode #editModeBtn,
body.light-mode #themeToggleBtn,
body.light-mode #autoReplyToggleBtn,
body.light-mode #ttsToggleBtn {
  background: var(--accent-ui);
  color: #000;
  border: 1px solid var(--accent-ui-strong);
}

#togglePromptsBtn {
  min-height: 34px;
  padding: 0 10px;
  font-size: 11px;
  background: #1d1d1d;
  color: #ddd;
}

#status {
  min-height: 16px;
  font-size: 11px;
  color: var(--muted);
}

.bg-music-status {
  font-size: 11px;
  color: var(--muted);
}

.general-model-row {
  display: none;
}

.general-model-row.active {
  display: flex;
}

.group-chat-character-bar {
  margin-top: 4px;
  display: none;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.group-chat-character-bar.active {
  display: flex;
}

.group-chat-character-btn {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  background: #262626;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  border: 2px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.group-chat-character-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

body.light-mode .group-chat-character-btn {
  background: #f0f0f0;
  border-color: #d0d0d0;
}

.group-chat-modal {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
}

.group-chat-modal.hidden {
  display: none;
}

.group-chat-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.group-chat-content {
  position: relative;
  background: var(--panel);
  border-radius: 16px;
  max-width: 90%;
  max-height: 80%;
  width: 400px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
}

.group-chat-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.group-chat-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

#groupChatCloseBtn {
  min-height: 32px;
  width: 32px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.group-chat-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.group-chat-body p {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: var(--muted);
}

.group-chat-thread-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.group-chat-thread-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
}

.group-chat-thread-item input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.group-chat-thread-name {
  flex: 1;
  font-size: 13px;
}

.group-chat-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

#groupChatApplyBtn {
  min-height: 36px;
  padding: 0 20px;
}

.image-viewer-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.image-viewer-modal.hidden {
  display: none;
}

.image-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.image-viewer-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.image-viewer-content img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

.js-help-modal {
  position: fixed;
  inset: 0;
  z-index: 1002;
  display: flex;
  align-items: center;
  justify-content: center;
}

.js-help-modal.hidden {
  display: none;
}

.js-help-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.js-help-content {
  position: relative;
  background: var(--panel);
  border-radius: 16px;
  max-width: 90%;
  max-height: 80%;
  width: 500px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
}

.js-help-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.js-help-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

#jsHelpCloseBtn {
  min-height: 32px;
  width: 32px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.js-help-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  font-size: 13px;
  line-height: 1.6;
}

.js-help-body h4 {
  margin: 16px 0 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.js-help-body p {
  margin: 8px 0;
  color: var(--muted);
}

.js-help-body ul {
  margin: 8px 0;
  padding-left: 20px;
}

.js-help-body li {
  margin: 4px 0;
  color: var(--muted);
}

.js-help-body code {
  background: #1a1a1a;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #f5a623;
}

body.light-mode .js-help-body code {
  background: #f0f0f0;
  color: #e38c05;
}

.js-example {
  background: #1a1a1a;
  border: 1px solid #2b2b2b;
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
}

body.light-mode .js-example {
  background: #f8f8f8;
  border-color: #d0d0d0;
}

.js-example strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 12px;
}

.js-example pre {
  margin: 0;
  padding: 8px;
  background: #0d0d0d;
  border-radius: 6px;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.5;
  color: #ddd;
}

body.light-mode .js-example pre {
  background: #ffffff;
  color: #333;
}

@media (max-height: 700px) {
  #app {
    padding: 6px;
  }

  .top-panel,
  .bottom-panel {
    padding: 8px;
  }

  .field-group textarea {
    max-height: 46px;
  }

  #userInput {
    max-height: 54px;
  }

  #threadSelect {
    max-width: 120px;
  }

  .ai-settings-row {
    gap: 4px;
  }

  .ai-setting input,
  .ai-setting select {
    min-height: 24px;
    font-size: 11px;
  }
}

