body {
  margin: 0;
  font-family: 'Segoe UI', 'Arial', sans-serif;
  background: #fffbe9;
  color: #222;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 5rem;
}

.navbar {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  padding: 2rem 0 1.5rem 0;
  font-size: 1.25rem;
  font-weight: 500;
  background: transparent;
  letter-spacing: 0.02em;
}

.navbar a {
  color: #444;
  text-decoration: none;
  transition: color 0.2s;
}

.navbar a:hover {
  color: #e6b800;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 60vh;
  margin-top: 3rem;
}

.title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
  letter-spacing: 0.01em;
  text-align: center;
  color: #222;
}

.site-footer {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  background-color: #fffbe9;
  padding-top: 0.5rem;
  z-index: 100;
}

.dad-joke {
  color: #4ca64c;
  font-size: 1.12rem;
  text-align: center;
  margin-bottom: 0.5rem;
  opacity: 0.98;
  letter-spacing: 0.01em;
  padding: 0.2em 0;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  background: none;
  border-radius: 0;
  display: block;
}

.copyright {
  text-align: center;
  font-size: 0.95rem;
  color: #aaa;
  margin-bottom: 0.5rem;
}

/* Tab and Chat UI Styling */
.tab-container {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 2em;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  max-width: 1000px;
  width: 100%;
}

.tabs {
  display: flex;
  border-bottom: 1px solid #e0e0e0;
}

.tab {
  padding: 1em 2em;
  cursor: pointer;
  border: none;
  background: none;
  font-size: 1.1em;
  color: #666;
  transition: color 0.2s;
}

.tab.active {
  border-bottom: 2px solid #e6b800;
  color: #e6b800;
  font-weight: bold;
  background: #fafafa;
}

.tab-content {
  display: none;
  padding: 2em;
  background: #fafafa;
  border-radius: 0 0 8px 8px;
}

.tab-content.active {
  display: block;
}

/* Chat UI */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 600px;
  max-width: 800px;
  margin: 0 auto;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 1em;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.chat-message {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-bottom: 0.5em;
}

.chat-message.user {
  align-items: flex-end;
}

.chat-message.llm {
  align-items: flex-start;
}

.chat-bubble {
  max-width: 70%;
  padding: 0.7em 1.1em;
  border-radius: 20px;
  margin-bottom: 2px;
  font-size: 1em;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(0,0,0,0.10);
  line-height: 1.5;
}

.chat-bubble.user {
  background: linear-gradient(135deg, #ffe066 60%, #ffd43b 100%);
  color: #222;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

.chat-bubble.llm {
  background: #f0f0f0;
  color: #222;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

/* Markdown styling within chat bubbles */
.chat-bubble h1,
.chat-bubble h2,
.chat-bubble h3,
.chat-bubble h4,
.chat-bubble h5,
.chat-bubble h6 {
  margin: 0.5em 0 0.3em 0;
  color: inherit;
  font-weight: bold;
}

.chat-bubble h1 { font-size: 1.4em; }
.chat-bubble h2 { font-size: 1.3em; }
.chat-bubble h3 { font-size: 1.2em; }
.chat-bubble h4 { font-size: 1.1em; }
.chat-bubble h5 { font-size: 1.05em; }
.chat-bubble h6 { font-size: 1em; }

.chat-bubble p {
  margin: 0.5em 0;
  line-height: 1.4;
}

.chat-bubble p:first-child {
  margin-top: 0;
}

.chat-bubble p:last-child {
  margin-bottom: 0;
}

.chat-bubble ul,
.chat-bubble ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}

.chat-bubble li {
  margin: 0.2em 0;
}

.chat-bubble blockquote {
  margin: 0.5em 0;
  padding: 0.5em 1em;
  border-left: 3px solid #ccc;
  background: rgba(0,0,0,0.05);
  border-radius: 4px;
  font-style: italic;
}

.chat-bubble code {
  background: rgba(0,0,0,0.1);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
}

.chat-bubble pre {
  background: rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 6px;
  padding: 1em;
  margin: 0.5em 0;
  overflow-x: auto;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
  line-height: 1.4;
}

.chat-bubble pre code {
  background: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  font-size: inherit;
}

.chat-bubble table {
  border-collapse: collapse;
  margin: 0.5em 0;
  font-size: 0.9em;
}

.chat-bubble th,
.chat-bubble td {
  border: 1px solid #ddd;
  padding: 0.3em 0.6em;
  text-align: left;
}

.chat-bubble th {
  background: rgba(0,0,0,0.05);
  font-weight: bold;
}

.chat-bubble a {
  color: #007acc;
  text-decoration: none;
}

.chat-bubble a:hover {
  text-decoration: underline;
}

.chat-bubble hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 1em 0;
}

.chat-bubble strong {
  font-weight: bold;
}

.chat-bubble em {
  font-style: italic;
}

.chat-bubble del {
  text-decoration: line-through;
}

/* Special styling for code blocks in LLM bubbles */
.chat-bubble.llm pre {
  background: #f8f8f8;
  border: 1px solid #e0e0e0;
}

/* Apply special styling to inline code elements */
.chat-bubble.llm code {
  background: #f8f8f8;
  border: 1px solid #e0e0e0;
}

/* Remove styling from code elements inside pre blocks */
.chat-bubble.llm pre code {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

.chat-bubble.llm blockquote {
  background: rgba(0,0,0,0.03);
  border-left-color: #999;
}

.chat-input-row {
  display: flex;
  gap: 0.5em;
  padding: 1em;
  background: #f9f9f9;
  border-radius: 0 0 8px 8px;
}

.chat-input-row select {
  min-width: 120px;
  background: #fff;
  color: #222;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.5em;
}

.chat-input-row input[type='text'] {
  flex: 1;
  padding: 0.5em;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  color: #222;
}

.chat-input-row button {
  padding: 0.5em 1.2em;
  background: #e6b800;
  color: #222;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
  font-weight: 600;
}

.chat-input-row button:hover {
  background: #d4a500;
}

.chat-input-row button:disabled {
  background: #ccc;
  color: #666;
  cursor: not-allowed;
}

/* Model Management */
.model-mgmt-container {
  display: flex;
  gap: 2em;
  align-items: flex-start;
}

.model-mgmt-pane {
  flex: 1 1 0;
  min-width: 0;
}

.model-mgmt-pane h3 {
  margin-top: 0;
  color: #222;
}

.model-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.model-table td {
  padding: 0.5em 0.75em;
  vertical-align: middle;
  border-bottom: 1px solid #eee;
  color: #222;
}

.model-table tr:last-child td {
  border-bottom: none;
}

.model-table button {
  background: #e6b800;
  color: #222;
  border: none;
  border-radius: 4px;
  padding: 0.3em 0.8em;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.model-table button:hover {
  background: #d4a500;
}

.installing-btn {
  background: #ccc !important;
  color: #666 !important;
  font-weight: bold;
  opacity: 1 !important;
  border: 1px solid #999;
  cursor: wait;
}

/* Model label styles */
.model-label {
  display: inline-block;
  background-color: #007acc;
  color: white;
  padding: 2px 8px;
  margin-left: 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
}

.model-label.reasoning {
  background-color: #808080;
}

.model-label.vision {
  background-color: #007acc;
}

.model-label.other {
  background-color: #27ae60;
}

.model-label.embeddings {
  background-color: #9b59b6;
}

.model-label.reranking {
  background-color: #ca4747;
}

.model-labels-container {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Model Registration Form */
.model-mgmt-register-form {
  background: linear-gradient(135deg, #ffffff 0%, #fefdfb 100%);
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  margin-bottom: 1.5em;
  padding: 1.5em 2em 1.2em 2em;
  max-width: 750px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  position: relative;
  overflow: visible;
  transition: padding 0.3s ease;
}

/* Collapsed state */
.model-mgmt-register-form.collapsed {
  padding: 1.5em 2em 1.2em 2em;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.model-mgmt-register-form.collapsed .form-content {
  display: none;
}

.model-mgmt-register-form::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #e6b800, #f4c842, #e6b800);
  border-radius: 12px 12px 0 0;
}

.model-mgmt-form-title {
  margin-top: 0;
  color: #1a1a1a;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.2em;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 0.75em;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.model-mgmt-form-title:hover {
  color: #333;
}

/* Collapsed state title margin adjustment */
.model-mgmt-register-form.collapsed .model-mgmt-form-title {
  margin-bottom: 0;
}

.model-mgmt-form-title::before {
  content: '▶';
  font-size: 0.8em;
  color: #666;
  transition: transform 0.3s ease;
  transform-origin: center;
}

/* Rotate chevron when expanded */
.model-mgmt-register-form:not(.collapsed) .model-mgmt-form-title::before {
  transform: rotate(90deg);
}

/* Hide the separate toggle indicator since we're using the gear */
.form-toggle-indicator {
  display: none;
}

/* Specific styling for title tooltip */
.model-mgmt-form-title .tooltip-icon {
  margin-left: 12px;
  font-size: 16px;
}

.model-mgmt-form-title .tooltip-icon::after {
  width: 250px;
  font-size: 13px;
  left: auto;
  right: 0;
  transform: translateX(0);
}

.model-mgmt-form-title .tooltip-icon:hover::after {
  transform: translateX(0) translateY(-2px);
}

.register-form-row {
  display: flex;
  align-items: center;
  gap: 1.2em;
  margin-bottom: 1em;
  padding: 0.1em 0;
  position: relative;
}

.register-form-row-tight {
  margin-bottom: 0.8em;
  align-items: center;
  flex-wrap: wrap;
}

.register-form-row:last-child {
  margin-bottom: 0;
  margin-top: 1.4em;
  padding-top: 1em;
  border-top: 1px solid #f0f0f0;
}

.register-label {
  min-width: 120px;
  color: #333;
  font-weight: 600;
  font-size: 0.95em;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 0.85em;
}

.register-label.reasoning-inline {
  margin-left: 1.5em;
  font-weight: 500;
  font-size: 0.9em;
  color: #555;
  display: flex;
  align-items: center;
  gap: 0.5em;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: normal;
}

.register-label.reasoning-inline input[type="checkbox"] {
  transform: scale(1.1);
  accent-color: #e6b800;
}

.register-model-name-group {
  display: flex;
  align-items: stretch;
  flex: 1;
  border-radius: 6px;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.register-model-name-group:focus-within {
  box-shadow: 0 2px 12px rgba(230,184,0,0.25);
}

.register-model-prefix {
  background: #e6b800;
  color: #fff;
  font-weight: 600;
  border-radius: 4px 0 0 4px;
  padding: 0.45em 0.7em;
  font-size: 1em;
  border: 1px solid #ddd;
  border-right: none;
}

.styled-prefix {
  background: linear-gradient(135deg, #f8f8f8 0%, #f0f0f0 100%);
  color: #666;
  border: 1px solid #d5d5d5;
  border-right: none;
  border-radius: 6px 0 0 6px;
  padding: 0.6em 0.8em;
  font-size: 0.95em;
  font-family: inherit;
  font-weight: 500;
  height: 100%;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  min-width: 50px;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

#register-model-name {
  border-radius: 0 6px 6px 0;
  border: 1px solid #d5d5d5;
  border-left: none;
  padding: 0.6em 0.8em;
  font-size: 0.95em;
  background: #fff;
  color: #222;
  flex: 1;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

#register-model-name:focus {
  border-color: #e6b800;
}

.form-input-wrapper {
  position: relative;
  width: 100%;
}

#register-recipe {
  min-width: 160px;
  flex: 1;
  border-radius: 6px;
  border: 1px solid #d5d5d5;
  padding: 0.6em 0.8em;
  font-size: 0.95em;
  background: #fff;
  color: #222;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

#register-recipe:focus {
  border-color: #e6b800;
  box-shadow: 0 2px 12px rgba(230,184,0,0.25);
}

.register-doc-link {
  margin-left: 0.8em;
  color: #007acc;
  font-size: 0.9em;
  text-decoration: none;
  transition: all 0.2s ease;
  padding: 0.3em 0.6em;
  border-radius: 4px;
  background: rgba(0,122,204,0.1);
  border: 1px solid rgba(0,122,204,0.2);
  white-space: nowrap;
}

.register-doc-link:hover {
  color: #fff;
  background: #007acc;
  border-color: #007acc;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,122,204,0.3);
}

#register-mmproj, #register-checkpoint {
  border-radius: 6px;
  border: 1px solid #d5d5d5;
  padding: 0.6em 0.8em;
  font-size: 0.95em;
  background: #fff;
  color: #222;
  flex: 1;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

#register-mmproj:focus, #register-checkpoint:focus {
  border-color: #e6b800;
  box-shadow: 0 2px 12px rgba(230,184,0,0.25);
}

#register-submit {
  background: linear-gradient(135deg, #e6b800 0%, #f4c842 100%);
  color: #222;
  border: none;
  border-radius: 8px;
  padding: 0.8em 2em;
  font-weight: 700;
  font-size: 0.95em;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0;
  box-shadow: 0 3px 12px rgba(230,184,0,0.3);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
}

#register-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transition: left 0.5s ease;
}

#register-submit:hover:enabled {
  background: linear-gradient(135deg, #d4a500 0%, #e6b800 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(230,184,0,0.4);
}

#register-submit:hover:enabled::before {
  left: 100%;
}

#register-submit:disabled {
  background: linear-gradient(135deg, #ccc 0%, #bbb 100%);
  color: #666;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.register-status {
  margin-left: 1.2em;
  font-size: 0.95em;
  font-weight: 600;
  padding: 0.4em 0.8em;
  border-radius: 6px;
  transition: all 0.2s ease;
}

/* Make placeholder text in Add a Model form lighter and more elegant */
#register-model-form input::placeholder {
    color: #aaa;
    opacity: 1;
    font-style: italic;
}

#register-model-form input:focus::placeholder {
    color: #ccc;
    transform: translateX(4px);
    transition: all 0.2s ease;
}

/* Success status styling */
.register-status.success {
  background: rgba(39, 174, 96, 0.1);
  color: #27ae60;
  border: 1px solid rgba(39, 174, 96, 0.3);
}

/* Error status styling */
.register-status.error {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  border: 1px solid rgba(220, 53, 69, 0.3);
}

/* Tooltip styles */
.tooltip-icon {
  display: inline;
  color: #007acc;
  font-size: 14px;
  margin-left: 8px;
  cursor: help;
  position: relative;
  text-transform: none;
}

.tooltip-icon:hover {
  color: #0086ef;
}

.tooltip-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(28, 28, 30, 0.98);
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 400;
  width: 200px;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  line-height: 1.4;
  pointer-events: none;
  text-transform: none;
}

.tooltip-icon:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-2px);
}

/* Smart positioning for tooltips near edges */
.tooltip-icon:nth-last-child(-n+2)::after,
.register-form-row:last-child .tooltip-icon::after {
  left: auto;
  right: 0;
  transform: translateX(0);
  width: 180px;
}

.tooltip-icon:nth-last-child(-n+2):hover::after,
.register-form-row:last-child .tooltip-icon:hover::after {
  transform: translateX(0) translateY(-2px);
}

/* Adjust label layout to accommodate tooltip icon */
.register-label {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

/* Adjust reasoning inline label for tooltip */
.register-label.reasoning-inline {
  align-items: center;
}

.register-label.reasoning-inline .tooltip-icon {
  margin-left: 8px;
}

/* Special positioning for reasoning tooltip to prevent overflow */
.register-label.reasoning-inline .tooltip-icon::after {
  left: auto !important;
  right: 0 !important;
  transform: translateX(0) !important;
  width: 160px !important;
  max-width: 260px !important;
  white-space: pre-line !important;
  word-break: break-word !important;
}

.register-label.reasoning-inline .tooltip-icon:hover::after {
  transform: translateX(0) translateY(-2px) !important;
}

@media (max-width: 600px) {
  .title { 
    font-size: 2rem; 
  }
  .navbar { 
    font-size: 1rem; 
    gap: 1.2rem; 
  }
  .main { 
    margin-top: 1rem; 
  }
  .model-mgmt-container {
    flex-direction: column;
    gap: 1em;
  }
}

@media (max-width: 800px) {
  .model-mgmt-register-form {
    padding: 1.2em 1em 1em 1em;
    margin: 0 1em 1.5em 1em;
  }
  
  .register-form-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6em;
  }
  
  .register-label {
    min-width: 0;
    font-size: 0.9em;
  }
  
  .register-label.reasoning-inline {
    margin-left: 0;
    margin-top: 0.5em;
    justify-content: flex-start;
  }
  
  #register-model-name, #register-mmproj, #register-checkpoint {
    min-width: 0;
    width: 100%;
  }
  
  #register-recipe {
    min-width: 0;
    width: 100%;
  }
  
  .register-doc-link {
    margin-left: 0;
    margin-top: 0.5em;
    align-self: flex-start;
  }
  
  .register-form-row:last-child {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1em;
  }
  
  #register-submit {
    padding: 0.8em 1.5em;
    font-size: 0.9em;
  }
}

/* Ensure form container allows tooltip overflow */
.model-mgmt-register-form {
  position: relative;
  overflow: visible;
}

.register-form-row {
  position: relative;
}

/* Additional positioning rules for better tooltip placement */
.register-label .tooltip-icon::after {
  width: 200px;
}

/* Ensure tooltips for rightmost elements don't get cut off */
.register-form-row-tight .tooltip-icon:last-child::after {
  left: auto;
  right: 0;
  transform: translateX(0);
  width: 180px;
}

.register-form-row-tight .tooltip-icon:last-child:hover::after {
  transform: translateX(0) translateY(-2px);
}

.register-form-row-tight .tooltip-icon:last-child::before {
  left: auto;
  right: 8px;
  transform: translateX(0);
}

.register-form-row-tight .tooltip-icon:last-child:hover::before {
  transform: translateX(0) translateY(-2px);
}

/* App Suggestions Section */
.app-suggestions-section {
  margin-top: 2rem;
  padding: 1.5rem 0;
  text-align: center;
  border-top: 1px solid #e0e0e0;
  background: #fafafa;
}

.suggestion-text {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.suggestion-highlight {
  font-size: 1.2rem;
  margin-right: 0.5rem;
  opacity: 0.8;
}

.app-logos-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
  flex-wrap: nowrap;
  padding: 0 1rem;
}

.app-logo-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 8px;
  background: #fff;
  padding: 0.3rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  position: relative;
}

.app-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.app-logo-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  background: #fff;
}

.app-name {
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  transition: color 0.3s ease;
}

/* Fallback styling for broken images */
.app-logo-item.image-failed {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px dashed #dee2e6;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.5rem;
}

.app-logo-item.image-failed:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  border-color: #adb5bd;
}

.app-logo-item.image-failed .app-logo-img {
  display: none;
}

.app-logo-item.image-failed .app-name {
  display: block;
  font-size: 0.7rem;
  color: #6c757d;
  font-weight: 500;
  text-align: center;
  line-height: 1.1;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Default hidden state for app names */
.app-logo-item:not(.image-failed) .app-name {
  display: none;
}

@media (max-width: 600px) {
  .app-logos-grid {
    gap: 0.5rem;
    padding: 0 0.5rem;
  }
  
  .app-logo-item {
    width: 48px;
    height: 48px;
  }
  
  .app-logo-img {
    border-radius: 3px;
  }
  
  .suggestion-text {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }
  
  .app-logo-item.image-failed .app-name {
    font-size: 0.6rem;
    line-height: 1.0;
  }
  
  .app-logo-item.image-failed {
    padding: 0.3rem;
  }
}

/* Think tokens styling */
.think-tokens-container {
  margin: 0.5em 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.1);
  background: rgba(0,0,0,0.02);
  transition: all 0.2s ease;
}

.think-tokens-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 0.6em 0.8em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5em;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  transition: all 0.2s ease;
  user-select: none;
}

.think-tokens-header:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.think-tokens-chevron {
  font-size: 0.8em;
  color: #666;
  transition: transform 0.2s ease;
  width: 12px;
  text-align: center;
}

.think-tokens-label {
  font-size: 0.9em;
  font-weight: 600;
  color: #555;
  font-style: italic;
}

.think-tokens-content {
  padding: 1em;
  background: rgba(0,0,0,0.03);
  border-top: 1px solid rgba(0,0,0,0.05);
  display: block;
}

.think-tokens-container.collapsed .think-tokens-content {
  display: none;
}

.think-tokens-container.collapsed .think-tokens-header {
  border-bottom: none;
}

.main-response {
  margin-top: 0.5em;
}

/* Ensure think tokens content inherits proper styling */
.think-tokens-content h1,
.think-tokens-content h2,
.think-tokens-content h3,
.think-tokens-content h4,
.think-tokens-content h5,
.think-tokens-content h6 {
  margin: 0.5em 0 0.3em 0;
  color: inherit;
  font-weight: bold;
}

.think-tokens-content p {
  margin: 0.5em 0;
  line-height: 1.4;
}

.think-tokens-content ul,
.think-tokens-content ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}

.think-tokens-content li {
  margin: 0.2em 0;
}

.think-tokens-content blockquote {
  margin: 0.5em 0;
  padding: 0.5em 1em;
  border-left: 3px solid #ccc;
  background: rgba(0,0,0,0.05);
  border-radius: 4px;
  font-style: italic;
}

.think-tokens-content code {
  background: rgba(0,0,0,0.1);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
}

.think-tokens-content pre {
  background: rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 6px;
  padding: 1em;
  margin: 0.5em 0;
  overflow-x: auto;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
  line-height: 1.4;
}

.think-tokens-content pre code {
  background: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  font-size: inherit;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}
