/* ─── Composer Area ─── */

.compare-context-banner {

  width: 100%;

  max-width: var(--composer-max);

  margin: 0 auto 10px;

  padding: 0 24px;

}

.compare-context-banner:not(.hidden) {

  position: absolute;

  left: 0;

  right: 0;

  bottom: 132px;

  z-index: 4;

  margin: 0;

  pointer-events: auto;

}

.compare-context-banner.hidden {

  display: none;

}

.compare-context-card {

  display: flex;

  align-items: flex-start;

  justify-content: space-between;

  gap: 16px;

  padding: 14px 16px;

  border: 1px solid var(--border);

  border-radius: var(--radius);

  background: var(--bg);

  box-shadow: var(--shadow-sm);

}

.compare-context-copy strong {

  display: block;

  font-size: 14px;

  font-weight: 650;

  margin-bottom: 4px;

}

.compare-context-copy p {

  margin: 0;

  font-size: 13px;

  line-height: 1.45;

  color: var(--text-secondary);

  max-width: 560px;

}

.compare-context-actions {

  display: flex;

  align-items: center;

  flex-wrap: wrap;

  justify-content: flex-end;

  gap: 8px;

  flex-shrink: 0;

}

.compare-context-primary,

.compare-context-secondary,

.compare-context-cancel {

  min-height: 34px;

  padding: 0 12px;

  border-radius: 8px;

  font-size: 13px;

  font-weight: 600;

  white-space: nowrap;

}

.compare-context-primary {

  color: var(--accent-contrast);

  background: var(--accent);

}

.compare-context-primary:hover {

  background: var(--accent-hover);

}

.compare-context-secondary {

  color: var(--text);

  background: var(--bg-secondary);

  border: 1px solid var(--border);

}

.compare-context-secondary:hover {

  background: var(--bg-secondary);

}

.compare-context-cancel {

  color: var(--text-secondary);

  background: transparent;

}

.compare-context-cancel:hover {

  color: var(--text);

  background: var(--bg-secondary);

}

.composer-area {

  position: absolute;

  view-transition-name: chat-composer;

  left: 0;

  right: 0;

  bottom: 0;

  z-index: 3;

  padding: 0 clamp(12px, 2vw, 24px) 18px;

  background: transparent;

  pointer-events: none;

  flex-shrink: 0;

  overflow: visible;

}

::view-transition-group(chat-messages),
::view-transition-group(chat-composer) {
  animation-duration: 220ms;
  animation-timing-function: cubic-bezier(.22, 1, .36, 1);
}

.composer-area .composer-wrap {

  pointer-events: auto;

}

.composer-area .app-footer {

  display: block;

  pointer-events: auto;

  padding: 10px 8px 0;

  font-size: 13px;

  line-height: 1.35;

  color: var(--text-tertiary);

}

.composer-area .app-footer a {

  color: inherit;

  text-decoration: none;

  border-radius: 6px;

  padding: 2px 5px;

  transition: color 120ms ease, background-color 120ms ease;

}

body.chat-empty .composer-area .app-footer {

  display: none;

}

.composer-area .app-footer a:hover,
.composer-area .app-footer a:focus-visible {

  color: var(--text);

  background: color-mix(in srgb, var(--text) 8%, transparent);

}

.composer-wrap {

  position: relative;

  width: 100%;

  max-width: var(--composer-max);

  margin: 0 auto;

  overflow: visible;

}

.composer-slot {

  position: relative;

}

.clarification-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: min(58vh, 520px);
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  box-shadow: var(--shadow-md);
}

.clarification-card.hidden { display: none; }

.clarification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

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

.clarification-header button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.clarification-header button:hover:not(:disabled) { background: var(--bg-secondary); color: var(--text); }
.clarification-header button:disabled { opacity: .3; cursor: default; }

.clarification-body {
  min-height: 0;
  padding: 4px 12px 12px;
  overflow-y: auto;
}

.clarification-body h2 {
  margin: 2px 4px 12px;
  font-size: 17px;
  font-weight: 620;
  line-height: 1.4;
}

.clarification-options { display: grid; gap: 5px; }

.clarification-option {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  padding: 9px 10px;
  text-align: left;
  font: inherit;
  font-size: 14px;
  line-height: 1.42;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.clarification-option:hover { background: var(--bg-secondary); color: var(--text); }
.clarification-option.selected { border-color: var(--border); background: var(--bg-secondary); color: var(--text); }

.clarification-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--text-tertiary) 14%, transparent);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.clarification-option-copy small {
  display: inline-block;
  margin-right: 6px;
  color: var(--text);
  font: inherit;
  font-weight: 700;
}

.clarification-custom {
  width: calc(100% - 8px);
  min-height: 62px;
  margin: 7px 4px 0;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  background: var(--bg-secondary);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
}

.clarification-custom:focus { border-color: var(--text-tertiary); }

.clarification-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--border-light);
}

.clarification-footer button {
  min-height: 38px;
  border: 0;
  border-radius: 11px;
  padding: 8px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.clarification-skip { background: transparent; color: var(--text-secondary); }
.clarification-skip:hover { background: var(--bg-secondary); color: var(--text); }
.clarification-continue { background: var(--accent); color: var(--accent-contrast); }
.clarification-continue:disabled { opacity: .4; cursor: default; }

/* Small viewports: compact the questions card and pin the question to the
   top of the scroll area so long option lists can't push it out of view. */
@media (max-width: 480px) {
  .clarification-card { max-height: 52vh; border-radius: 16px; margin-bottom: 8px; }
  .clarification-header { padding: 10px 12px 6px; font-size: 13px; }
  .clarification-body { padding: 0 8px 8px; }
  .clarification-body h2 {
    position: sticky;
    top: 0;
    z-index: 1;
    margin: 0 0 8px;
    padding: 8px 4px;
    background: var(--bg);
    font-size: 15px;
  }
  .clarification-options { gap: 4px; }
  .clarification-option { gap: 6px; padding: 7px 8px; font-size: 13px; }
  .clarification-key { width: 23px; height: 23px; }
  .clarification-footer { padding: 8px 10px 10px; }
  .clarification-footer button { min-height: 34px; }
}

.clarification-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px;
  color: var(--text-secondary);
  font-size: 14px;
}

.clarification-loading span {
  width: 15px;
  height: 15px;
  border: 2px solid var(--border);
  border-top-color: var(--text-secondary);
  border-radius: 50%;
  animation: research-spin .8s linear infinite;
}

.attachment-model-notice {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 24px);
  padding: 8px 9px 8px 12px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  font-size: 13px;
  line-height: 1.3;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms;
}

.attachment-model-notice.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.attachment-model-notice button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  padding: 0;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}

.attachment-model-notice button:hover {
  color: var(--text);
  background: var(--bg-secondary);
}

/* Desktop conversation navigation */
.chat-jump-bottom {
  position: absolute;
  top: -50px;
  left: 50%;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  color: var(--text);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px) scale(.96);
  transition: opacity var(--motion-fast) var(--ease-out), transform var(--motion-medium) var(--ease-out), visibility var(--motion-fast) var(--ease-out);
}

.chat-jump-bottom.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.chat-jump-bottom:active {
  transform: translateX(-50%) translateY(1px) scale(.95);
}

.chat-prompt-nav {
  position: absolute;
  top: 50%;
  right: 18px;
  z-index: 4;
  transform: translateY(-50%);
}

.chat-prompt-nav.hidden { display: none; }

.chat-prompt-rail {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-height: 76px;
  padding: 10px 8px;
  border-radius: var(--radius-full);
  color: var(--text-tertiary);
}

.chat-prompt-rail > span {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.chat-prompt-rail [data-prompt-marker] {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: var(--radius-full);
  background: currentColor;
  opacity: .48;
  transform: scaleX(.62);
  transform-origin: right center;
  transition: transform var(--motion-fast) var(--ease-out), opacity var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out);
}

.chat-prompt-rail [data-prompt-marker].active {
  color: var(--text);
  opacity: 1;
  transform: scaleX(1);
}

.chat-prompt-panel {
  position: absolute;
  top: 50%;
  right: 28px;
  width: min(320px, calc(100vw - 80px));
  max-height: min(248px, calc(100vh - 160px));
  padding: 10px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-50%) translateX(8px) scale(.98);
  transform-origin: right center;
  transition: opacity 160ms var(--ease-out), transform 180ms var(--ease-out), visibility 160ms var(--ease-out);
}

.chat-prompt-nav:hover .chat-prompt-panel,
.chat-prompt-nav:focus-within .chat-prompt-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0) scale(1);
}

.chat-prompt-list { display: grid; gap: 2px; }

.chat-prompt-list button {
  display: block;
  width: 100%;
  height: 36px;
  padding: 0 9px;
  overflow: hidden;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out);
}

.chat-prompt-list button:hover,
.chat-prompt-list button.active {
  background: var(--bg-secondary);
  color: var(--text);
}

.chat-prompt-list button:active { transform: scale(.985); }

@media (max-width: 900px), (hover: none), (pointer: coarse) {
  .chat-jump-bottom,
  .chat-prompt-nav { display: none !important; }
}

body.capacitor-native .chat-jump-bottom,
body.capacitor-native .chat-prompt-nav { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .chat-jump-bottom,
  .chat-jump-bottom.visible,
  .chat-prompt-panel,
  .chat-prompt-nav:hover .chat-prompt-panel,
  .chat-prompt-nav:focus-within .chat-prompt-panel,
  .chat-prompt-rail [data-prompt-marker] {
    transition-duration: 0.01ms;
  }
}

.followup-queue {

  display: grid;

  gap: 8px;

  margin: 0 0 8px;

}

.followup-queue.hidden {

  display: none;

}

.followup-pill {

  display: flex;

  align-items: center;

  gap: 9px;

  min-height: 38px;

  padding: 8px 10px;

  border: 1px solid var(--border);

  border-radius: 16px;

  background: color-mix(in srgb, var(--bg) 92%, var(--surface));

  box-shadow: var(--shadow-sm);

}

.followup-pill.is-editing {

  flex-wrap: wrap;

}

.followup-index {

  display: inline-flex;

  align-items: center;

  justify-content: center;

  width: 20px;

  height: 20px;

  border-radius: var(--radius-full);

  background: var(--surface);

  color: var(--text-secondary);

  font-size: 12px;

  font-weight: 650;

  flex: 0 0 auto;

}

.followup-text {

  min-width: 0;

  flex: 1;

  color: var(--text);

  font-size: 13px;

  line-height: 1.35;

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;

}

.followup-media-count {

  flex: 0 0 auto;

  color: var(--text-secondary);

  background: var(--surface);

  border-radius: var(--radius-full);

  padding: 3px 8px;

  font-size: 12px;

  font-weight: 650;

}

.followup-media-strip {

  display: flex;

  gap: 6px;

  width: 100%;

  padding-left: 29px;

}

.followup-media-strip img {

  width: 44px;

  height: 44px;

  border-radius: 10px;

  border: 1px solid var(--border);

  object-fit: cover;

}

.followup-input {

  min-width: 0;

  flex: 1;

  height: 30px;

  border: 1px solid var(--border);

  border-radius: 10px;

  background: var(--bg);

  color: var(--text);

  outline: none;

  padding: 0 10px;

  font: inherit;

  font-size: 13px;

}

.followup-input:focus {

  border-color: var(--accent);

}

.followup-edit,

.followup-delete {

  border: 0;

  background: transparent;

  color: var(--text-secondary);

  font-size: 12px;

  font-weight: 650;

  cursor: pointer;

  flex: 0 0 auto;

}

.followup-edit:hover,

.followup-delete:hover {

  color: var(--text);

}

.followup-delete {

  display: inline-flex;

  align-items: center;

  justify-content: center;

  width: 26px;

  height: 26px;

  border-radius: var(--radius-full);

}

.followup-delete:hover {

  background: var(--surface);

}

.composer {

  position: relative;

  overflow: visible;

  background: var(--bg);

  border: 1px solid var(--border);

  border-radius: 28px;

  padding: 12px 14px 10px;

  box-shadow: var(--shadow-md);

}

.composer.drag-over {

  border-color: var(--accent);

  box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-md);

}

@keyframes composer-mode-pop {
  from { transform: scale(0.97); }
  to { transform: scale(1); }
}

body:not(.capacitor-native) .composer {
  transition: border-radius 220ms cubic-bezier(0.32, 0.72, 0, 1), padding 220ms cubic-bezier(0.32, 0.72, 0, 1), box-shadow 180ms cubic-bezier(0.23, 1, 0.32, 1);
}

body:not(.capacitor-native) .composer:has(#researchModeChip:not(.hidden)) {
  padding: 8px 12px 10px;
  border-radius: 20px;
  animation: composer-mode-pop 220ms cubic-bezier(0.32, 0.72, 0, 1);
}

body:not(.capacitor-native) .composer:has(#researchModeChip:not(.hidden)) .research-mode-chip:not(.hidden) {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0 0 8px;
  padding: 2px 2px 8px 6px;
  border: 0;
  border-bottom: 1px solid var(--border-light);
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

body:not(.capacitor-native) .composer:has(#researchModeChip:not(.hidden)) .research-mode-mark {
  flex: 0 0 auto;
  color: var(--text);
}

body:not(.capacitor-native) .composer:has(#researchModeChip:not(.hidden)) .research-mode-chip-label {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body:not(.capacitor-native) .composer:has(#researchModeChip:not(.hidden)) .research-mode-chip button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
  line-height: 0;
  cursor: pointer;
  transition: background 140ms ease, transform 140ms ease;
}

body:not(.capacitor-native) .composer:has(#researchModeChip:not(.hidden)) .research-mode-chip button:hover {
  background: color-mix(in srgb, var(--text) 15%, transparent);
}

body:not(.capacitor-native) .composer:has(#researchModeChip:not(.hidden)) .research-mode-chip button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 2px;
}

body:not(.capacitor-native) .composer:has(#researchModeChip:not(.hidden)) .research-mode-chip button:active {
  transform: scale(0.94);
}

@media (prefers-reduced-motion: reduce) {
  body:not(.capacitor-native) .composer:has(#researchModeChip:not(.hidden)) {
    animation: none;
  }
}

.composer-input {

  display: flex;

  flex-wrap: wrap;

  align-items: center;

  gap: 6px 8px;

}

.composer-input textarea,
.composer-input .composer-prompt {

  flex: 1 1 140px;

  width: auto;

  min-width: 8ch;

}

.composer textarea,
.composer .composer-prompt {

  width: 100%;

  border: none;

  background: transparent;

  color: var(--text);

  resize: none;

  outline: none;

  padding: 0;

  min-height: 26px;

  max-height: 260px;

  font-size: 15px;

  line-height: 1.45;

}

.composer .composer-prompt {

  overflow-y: auto;

  white-space: pre-wrap;

  word-break: break-word;

  position: relative;

}

.composer textarea::placeholder,
.composer .composer-prompt.is-placeholder::before {

  color: var(--text-tertiary);

}

.composer .composer-prompt.is-placeholder::before {

  content: attr(data-placeholder);

  pointer-events: none;

  position: absolute;

  left: 0;

  top: 0;

}

.composer .composer-prompt.is-skill-hint::after {
  content: attr(data-placeholder);
  color: var(--text-tertiary);
  pointer-events: none;
}

.composer .composer-prompt .composer-skill-token {

  margin: 0 0.2em 0 0;

}

.composer-bottom {

  display: flex;

  align-items: center;

  justify-content: space-between;

  margin-top: 8px;

}

.composer-actions {

  display: flex;

  align-items: center;

  gap: 8px;

  min-width: 0;

}

.composer-action-menu-wrap {

  position: relative;

  flex-shrink: 0;

  z-index: 6;

}

.composer-action-menu-wrap.is-open {

  z-index: 55;

}

.composer-tool {

  display: flex;

  align-items: center;

  justify-content: center;

  width: 38px;

  height: 38px;

  border-radius: 10px;

  color: var(--text-secondary);

  transition: background var(--transition), color var(--transition);

}

.composer-plus-btn {

  border-radius: var(--radius-full);

  background: var(--bg);

  border: 1px solid var(--border-light);

}

.composer-plus-btn[aria-expanded="true"] {

  background: var(--accent);

  border-color: var(--accent);

  color: var(--accent-contrast);

}

.composer-tool:hover {

  background: var(--bg-secondary);

  color: var(--text);

}

.composer-plus-btn[aria-expanded="true"]:hover {

  background: var(--accent-hover);

  color: var(--accent-contrast);

}

.composer-plus-btn svg {

  display: block;

  transform-origin: 50% 50%;

  transition: transform var(--motion-medium) var(--ease-out);

}

.composer-plus-btn[aria-expanded="true"] svg {

  transform: rotate(45deg);

}

@media (prefers-reduced-motion: reduce) {

  .composer-plus-btn svg {

    transition-duration: 0.01ms;

  }

}

.composer-action-menu {

  position: absolute;

  bottom: calc(100% + 10px);

  left: 0;

  width: min(280px, calc(100vw - 40px));

  padding: 8px;

  border-radius: 16px;

  background: var(--bg);

  border: 1px solid var(--border);

  box-shadow: var(--shadow-lg);

  z-index: 55;

  transform-origin: 20px 100%;

  animation: composer-menu-pop 180ms cubic-bezier(0.23, 1, 0.32, 1);

}

.composer-action-menu[data-page="root"] [data-menu-page="more"],
.composer-action-menu[data-page="more"] [data-menu-page="root"] {
  display: none !important;
}

@keyframes composer-menu-pop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .composer-action-menu {
    animation: none;
  }
}

.composer-action-menu-item {

  display: flex;

  align-items: center;

  gap: 12px;

  width: 100%;

  min-height: 44px;

  padding: 9px 11px;

  border-radius: 10px;

  color: var(--text);

  font-size: 15px;

  font-weight: 500;

  text-align: left;

  transition: background var(--transition);

}

.composer-action-menu-item:hover {

  background: var(--bg-secondary);

}

.composer-action-menu-item > svg {

  flex: 0 0 19px;

  color: var(--text-secondary);

}

.composer-action-menu-value {

  margin-left: auto;

  overflow: hidden;

  color: var(--text-tertiary);

  font-size: 13px;

  font-weight: 500;

  text-overflow: ellipsis;

  white-space: nowrap;

}

.composer-action-menu-item .composer-action-menu-chevron {

  flex-basis: 15px;

}

.composer-style-menu-back,

.composer-style-option {

  display: flex;

  align-items: center;

  width: 100%;

  min-height: 42px;

  border-radius: 10px;

  color: var(--text);

  font-size: 14px;

  text-align: left;

}

.composer-style-menu-back {

  gap: 9px;

  margin-bottom: 5px;

  padding: 7px 9px;

  border-bottom: 1px solid var(--border-light);

  border-radius: 8px 8px 0 0;

  color: var(--text-secondary);

  font-weight: 650;

}

.composer-style-option {

  justify-content: space-between;

  padding: 8px 11px;

  font-weight: 560;

  transition: background var(--transition), color var(--transition);

}

.composer-style-option + .composer-style-option {

  margin-top: 4px;

}

.composer-style-menu-back:hover,

.composer-style-option:hover,

.composer-style-option[aria-checked="true"] {

  background: var(--bg-secondary);

}

.composer-style-option svg {

  visibility: hidden;

  color: var(--accent);

}

.composer-style-option[aria-checked="true"] svg {

  visibility: visible;

}

.writing-style-pill {

  display: inline-flex;

  align-items: center;

  min-width: 0;

  height: 38px;

  padding: 0 7px 0 12px;

  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border-light));

  border-radius: var(--radius-full);

  background: color-mix(in srgb, var(--accent) 8%, var(--bg));

  color: var(--text);

  font-size: 13px;

  font-weight: 620;

}

.writing-style-pill.hidden {

  display: none;

}

.writing-style-pill > span {

  overflow: hidden;

  text-overflow: ellipsis;

  white-space: nowrap;

}

.writing-style-pill button {

  display: inline-flex;

  align-items: center;

  justify-content: center;

  width: 26px;

  height: 26px;

  margin-left: 4px;

  border-radius: var(--radius-full);

  color: var(--text-secondary);

}

.writing-style-pill button:hover {

  background: color-mix(in srgb, var(--text) 8%, transparent);

  color: var(--text);

}

.composer-skill-tokens {

  display: flex;

  flex-wrap: wrap;

  align-items: center;

  gap: 6px;

  min-width: 0;

}

.composer-skill-tokens:empty {

  display: none;

}

.composer-skill-token {

  display: inline;

  appearance: none;

  padding: 0;

  border: 0;

  background: transparent;

  color: inherit;

  font: inherit;

  line-height: inherit;

  white-space: nowrap;

  cursor: pointer;

  transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1);

}

.composer-skill-token:active {

  transform: scale(0.97);

}

.composer-skill-token.is-landing {

  opacity: 0;

}

.composer-skill-token-icon {

  display: inline-block;

  width: 1em;

  height: 1em;

  margin-right: 0.25em;

  vertical-align: -0.125em;

}

.composer-skill-token-icon svg {

  width: 100%;

  height: 100%;

  display: block;

}

.composer-skill-token[data-skill-id="humanizer"] {

  color: #22c55e;

}

.composer-skill-token[data-skill-id="illustration"] {

  color: #2e86de;

}

.composer-skill-token[data-skill-id="slides"] {
  color: #ea580c;
}

.composer-skill-token[data-skill-id="docs"] {
  color: #2563eb;
}

.composer-skill-token-icon {
  position: relative;
}

.composer-skill-token-icon > svg {
  transition: opacity 140ms ease, transform 180ms cubic-bezier(0.23, 1, 0.32, 1);
}

/* Hovering a chip swaps its icon for a remove mark (clicking the chip removes the skill). */
.composer-skill-token-remove {
  position: absolute;
  inset: -0.08em;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, currentColor 16%, transparent);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 140ms ease, transform 180ms cubic-bezier(0.23, 1, 0.32, 1);
}

.composer-skill-token-remove svg {
  width: 72%;
  height: 72%;
}

.composer-prompt .composer-skill-token:hover .composer-skill-token-icon > svg,
.composer-prompt .composer-skill-token:focus-visible .composer-skill-token-icon > svg {
  opacity: 0;
  transform: scale(0.6);
}

.composer-prompt .composer-skill-token:hover .composer-skill-token-remove,
.composer-prompt .composer-skill-token:focus-visible .composer-skill-token-remove {
  opacity: 1;
  transform: none;
}

.composer-skill-token[data-skill-id="visualize"] {

  color: #8b5cf6;

}

.composer-skill-token-fly {

  position: fixed;

  z-index: 80;

  margin: 0;

  pointer-events: none;

}

.skill-command-menu {

  position: absolute;

  left: 0;

  right: 0;

  bottom: calc(100% + 10px);

  max-height: min(280px, 40dvh);

  overflow-y: auto;

  padding: 6px;

  border-radius: 18px;

  background: var(--bg);

  border: 1px solid var(--border);

  box-shadow: var(--shadow-lg);

  z-index: 56;

}

body.chat-empty .skill-command-menu {

  top: calc(100% + 10px);

  bottom: auto;

}

.skill-command-menu.hidden {

  display: none;

}

.skill-command-option {

  display: flex;

  align-items: center;

  gap: 12px;

  width: 100%;

  min-height: 44px;

  padding: 8px 11px;

  border-radius: 12px;

  color: var(--text);

  text-align: left;

  transition: background var(--transition);

}

.skill-command-option.is-active,

.skill-command-option:hover {

  background: var(--bg-secondary);

}

.skill-command-option:active {

  transform: scale(0.99);

}

.skill-command-option.is-applied {

  box-shadow: inset 3px 0 0 var(--accent);

}

.skill-command-icon {

  display: inline-flex;

  flex: 0 0 22px;

  align-items: center;

  justify-content: center;

  width: 22px;

  height: 22px;

  color: var(--text);

}

.skill-command-option[data-skill-id="humanizer"] .skill-command-icon {

  color: #22c55e;

}

.skill-command-option[data-skill-id="illustration"] .skill-command-icon {

  color: #2e86de;

}

.skill-command-option[data-skill-id="visualize"] .skill-command-icon {

  color: #8b5cf6;

}

.skill-command-option[data-skill-id="slides"] .skill-command-icon {

  color: #ea580c;

}

.skill-command-option[data-skill-id="docs"] .skill-command-icon {

  color: #2563eb;

}

.skill-command-icon svg {

  width: 22px;

  height: 22px;

}

.skill-command-name {

  flex: 0 0 auto;

  font-size: 15px;

  font-weight: 600;

}

.skill-command-desc {

  min-width: 0;

  overflow: hidden;

  color: var(--text-tertiary);

  font-size: 13px;

  font-weight: 500;

  text-overflow: ellipsis;

  white-space: nowrap;

}

.skill-command-check {

  flex: 0 0 auto;

  margin-left: auto;

  color: var(--accent);

  font-size: 16px;

  font-weight: 700;

}

.skill-command-empty {

  padding: 10px 11px;

  color: var(--text-tertiary);

  font-size: 13px;

  font-weight: 500;

}

@media (prefers-reduced-motion: reduce) {

  .skill-command-option,

  .composer-skill-token {

    transition-duration: 0.01ms;

  }

  .composer-skill-token:active,

  .skill-command-option:active {

    transform: none;

  }

}

.web-search-toggle[aria-pressed="true"] {

  color: #2e86de;

}

.web-search-toggle[aria-pressed="true"]:hover {

  background: rgba(46, 134, 222, 0.2);

}

.web-search-toggle[aria-pressed="false"] {

  opacity: 0.55;

}

.web-search-toggle[aria-pressed="false"]:hover {

  opacity: 1;

}

/* ── Sources pill (web search citations) ── */

.artifact-list {

  display: grid;

  gap: 8px;

  margin: 14px 0 0;

  max-width: 480px;

}

.artifact-card {
  --artifact-ink: #6b7280;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 68px;
  padding: 12px 18px 12px 14px;
  border: 1px solid var(--artifact-border, #e3e3e3);
  border-radius: 16px;
  background: var(--artifact-bg, #ffffff);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  color: var(--text);
  font: inherit;
  text-align: left;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

body[data-mode="dark"] .artifact-card {
  --artifact-bg: #1e1e1e;
  --artifact-border: #333333;
  --artifact-bg-hover: #262626;
  --artifact-border-hover: #444444;
  box-shadow: none;
}

button.artifact-card { cursor: pointer; }

button.artifact-card:hover {
  background: var(--artifact-bg-hover, #f7f7f8);
  border-color: var(--artifact-border-hover, #d4d4d8);
}

button.artifact-card:active { transform: scale(0.99); }

button.artifact-card:focus-visible {
  outline: 2px solid var(--artifact-ink);
  outline-offset: 2px;
}

.artifact-card[data-kind="pdf"] { --artifact-ink: #e5484d; }
.artifact-card[data-kind="word"] { --artifact-ink: #2b7cd3; }
.artifact-card[data-kind="excel"] { --artifact-ink: #1d9a5b; }
.artifact-card[data-kind="slides"] { --artifact-ink: #e8642c; }

body[data-mode="dark"] .artifact-card[data-kind="pdf"] { --artifact-ink: #ff6369; }
body[data-mode="dark"] .artifact-card[data-kind="word"] { --artifact-ink: #4c9bf0; }
body[data-mode="dark"] .artifact-card[data-kind="excel"] { --artifact-ink: #3dd68c; }
body[data-mode="dark"] .artifact-card[data-kind="slides"] { --artifact-ink: #ff8a4c; }
body[data-mode="dark"] .artifact-card[data-kind="file"],
body[data-mode="dark"] .artifact-card[data-kind="text"] { --artifact-ink: #a1a1aa; }

.artifact-icon {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--artifact-ink);
}

.artifact-icon svg {
  display: block;
  margin-bottom: -13px;
}

.artifact-icon-tag {
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
}

.artifact-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.artifact-title {
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.3;
}

.artifact-card.pending .artifact-icon { opacity: 0.6; }

/* Uploaded documents (composer chip and sent message): the generated-file icon, smaller. */
.file-type-icon {
  --file-icon-size: 24px;
  --file-ink: #71717a;
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: calc(var(--file-icon-size) + 4px);
  height: calc(var(--file-icon-size) + 4px);
  color: var(--file-ink);
}

.file-type-icon svg {
  display: block;
  width: var(--file-icon-size);
  height: var(--file-icon-size);
  margin-bottom: calc(var(--file-icon-size) * -0.43);
}

.file-type-icon .file-type-icon-tag,
.preview-file .file-type-icon .file-type-icon-tag {
  overflow: visible;
  color: var(--file-ink);
  font-size: calc(var(--file-icon-size) * 0.34);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
}

/* Beats `.preview-file span`, which would grey the page outline (the icon is a span). */
.preview-file .file-type-icon {
  overflow: visible;
  color: var(--file-ink);
}

.file-type-icon[data-kind="pdf"] { --file-ink: #e5484d; }
.file-type-icon[data-kind="word"] { --file-ink: #2b7cd3; }
.file-type-icon[data-kind="excel"] { --file-ink: #1d9a5b; }
.file-type-icon[data-kind="slides"] { --file-ink: #e8642c; }

body[data-mode="dark"] .file-type-icon[data-kind="pdf"] { --file-ink: #ff6369; }
body[data-mode="dark"] .file-type-icon[data-kind="word"] { --file-ink: #4c9bf0; }
body[data-mode="dark"] .file-type-icon[data-kind="excel"] { --file-ink: #3dd68c; }
body[data-mode="dark"] .file-type-icon[data-kind="slides"] { --file-ink: #ff8a4c; }
body[data-mode="dark"] .file-type-icon[data-kind="file"],
body[data-mode="dark"] .file-type-icon[data-kind="text"] { --file-ink: #a1a1aa; }

.artifact-card.pending.failed {
  --artifact-ink: #d14343;
  border-color: color-mix(in srgb, #d14343 35%, var(--artifact-border, #e3e3e3));
}

.artifact-card.pending.failed .artifact-status { color: #d14343; }

.artifact-spinner {

  width: 12px;

  height: 12px;

  border-radius: 50%;

  border: 2px solid currentColor;

  border-top-color: transparent;

  animation: artifact-spin 0.8s linear infinite;

  display: inline-block;

}

@keyframes artifact-spin {

  to { transform: rotate(360deg); }

}

.weather-card {
  width: min(100%, 420px);
  padding: 18px 18px 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-md);
}

.weather-card-header,
.weather-current,
.weather-hourly,
.weather-day,
.weather-place,
.weather-stats,
.weather-unit-toggle,
.weather-header-end {
  display: flex;
  align-items: center;
}

.weather-card-header {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.weather-place {
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
}

.weather-country,
.weather-now-label,
.weather-feels,
.weather-stats,
.weather-low,
.weather-hour > span:first-child,
.weather-attribution {
  color: var(--text-secondary);
  font-weight: 500;
}

.weather-header-end {
  flex: 0 0 auto;
  gap: 8px;
}

.weather-now-label {
  font-size: 13px;
  text-transform: lowercase;
}

.weather-unit-toggle {
  gap: 0;
  padding: 2px;
  border-radius: 999px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}

.weather-unit-toggle button {
  min-width: 34px;
  height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.weather-unit-toggle button.is-active {
  background: var(--text);
  color: var(--bg);
}

.weather-current {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px 14px;
  align-items: start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.weather-current-icon {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
}

.weather-symbol--sun {
  color: #f5b400;
}

.weather-symbol--moon {
  color: #6aa8ff;
}

.weather-symbol--cloud,
.weather-symbol--rain,
.weather-symbol--storm,
.weather-symbol--snow {
  color: var(--text-secondary);
}

.weather-current-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.weather-temperature {
  font-size: 52px;
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-weight: 700;
}

.weather-current-main > span {
  font-size: 15px;
  font-weight: 500;
}

.weather-current-meta {
  display: grid;
  gap: 4px;
  justify-items: end;
  text-align: right;
  font-size: 12px;
}

.weather-hi-lo {
  font-size: 15px;
  font-weight: 650;
}

.weather-hi-lo span {
  color: var(--text-secondary);
  font-weight: 500;
}

.weather-stats {
  gap: 10px;
  margin-top: 2px;
}

.weather-stats span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.weather-stats svg {
  flex: 0 0 auto;
  opacity: 0.85;
}

.weather-hourly {
  display: flex;
  justify-content: space-between;
  gap: 2px;
  padding: 14px 0;
  overflow: visible;
  border-bottom: 1px solid var(--border);
}

.weather-hour {
  display: grid;
  flex: 1 1 0;
  min-width: 0;
  justify-items: center;
  gap: 6px;
  font-size: 11px;
}

.weather-hour > span:first-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weather-hour strong {
  font-size: 12px;
  font-weight: 650;
}

.weather-symbol {
  width: 22px;
  height: 22px;
  line-height: 1;
}

.weather-daily {
  display: grid;
  gap: 8px;
  padding-top: 14px;
}

.weather-day {
  display: grid;
  grid-template-columns: 48px 28px 36px minmax(72px, 1fr) 40px;
  gap: 8px;
  font-size: 13px;
}

.weather-day strong {
  font-weight: 600;
}

.weather-high {
  text-align: right;
  font-weight: 650;
}

.weather-range {
  position: relative;
  height: 5px;
  border-radius: 999px;
  background: var(--bg-secondary);
  overflow: hidden;
}

.weather-range i {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #5ac8fa 0%, #ffd60a 100%);
}

.weather-attribution {
  display: inline-block;
  margin-top: 12px;
  font-size: 11px;
  text-decoration: none;
}

.weather-attribution:hover {
  color: var(--text);
  text-decoration: underline;
}

.artifact-list:has(.weather-card) {
  margin-bottom: 10px;
}

@media (max-width: 600px) {
  .weather-card { width: min(100%, 100%); padding: 16px 14px 12px; }
  .weather-current { grid-template-columns: auto 1fr; }
  .weather-current-meta { grid-column: 1 / -1; justify-items: start; text-align: left; }
  .weather-temperature { font-size: 44px; }
  .weather-day { grid-template-columns: 44px 26px 34px minmax(64px, 1fr) 36px; }
}

.sources-pill {

  margin: 0;

  max-width: 100%;

}

/* ── Page citation chips (where a document is cited) ── */

.page-cite {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 18px;
  margin: 0 1px;
  padding: 0 6px 0 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font: 600 10.5px/1 var(--font-sans, inherit);
  font-variant-numeric: tabular-nums;
  vertical-align: 0.12em;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.page-cite svg { flex: none; opacity: .75; }

.page-cite:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

@media (hover: hover) {
  .page-cite:hover { background: color-mix(in srgb, var(--accent) 16%, var(--bg-secondary)); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--text); }
}

/* ── Inline citation pills (end of paragraph) ── */

.inline-source-pill {

  display: inline-block;

  vertical-align: middle;

  position: relative;

  margin-left: 5px;

  max-width: 100%;

}

.inline-source-pill-trigger {

  display: inline-flex;

  align-items: center;

  gap: 5px;

  list-style: none;

  cursor: pointer;

  padding: 3px 9px 3px 5px;

  border-radius: 999px;

  background: var(--bg-secondary);

  border: 1px solid var(--border);

  font-size: 12px;

  font-weight: 500;

  color: var(--text-secondary);

  line-height: 1.2;

  transition: background var(--transition), border-color var(--transition);

  user-select: none;

}

.inline-source-pill-trigger::-webkit-details-marker {

  display: none;

}

.inline-source-pill-trigger::marker {

  content: "";

}

.inline-source-pill-trigger:hover {

  background: var(--border-light);

  border-color: var(--border);

}

.inline-source-favicon {

  width: 14px;

  height: 14px;

  border-radius: 50%;

  flex-shrink: 0;

  object-fit: cover;

  background: var(--bg);

  border: 1px solid var(--border-light);

}

.inline-source-pill-label {

  color: var(--text);

  font-weight: 600;

  max-width: 120px;

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;

}

.inline-source-pill-more {

  color: var(--text-secondary);

  font-weight: 600;

  font-size: 11.5px;

}

.inline-source-panel {

  position: absolute;

  left: 0;

  top: calc(100% + 6px);

  z-index: 20;

  min-width: 220px;

  max-width: min(320px, 90vw);

  display: flex;

  flex-direction: column;

  gap: 2px;

  padding: 6px;

  border-radius: 10px;

  background: var(--bg);

  border: 1px solid var(--border);

  box-shadow: var(--shadow-md);

}

.inline-source-row {

  display: flex;

  align-items: center;

  gap: 8px;

  padding: 7px 8px;

  border-radius: 7px;

  text-decoration: none;

  color: inherit;

  transition: background var(--transition);

  width: 100%;

  border: 0;

  background: transparent;

  font: inherit;

  text-align: left;

  cursor: pointer;

}

.inline-source-row:hover {

  background: var(--bg-secondary);

}

.inline-source-row.is-static {

  cursor: default;

}

.inline-source-row img {

  flex: 0 0 14px;

  border-radius: 3px;

}

.inline-source-row-title {

  flex: 1;

  min-width: 0;

  font-size: 12.5px;

  font-weight: 500;

  color: var(--text);

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;

}

.inline-source-row-host {

  flex: 0 0 auto;

  font-size: 11px;

  color: var(--text-secondary);

}

.sources-pill-trigger {

  display: inline-flex;

  align-items: center;

  gap: 8px;

  list-style: none;

  cursor: pointer;

  padding: 6px 12px 6px 8px;

  border-radius: 999px;

  background: var(--bg-secondary);

  border: 1px solid var(--border);

  font-size: 13px;

  font-weight: 500;

  color: var(--text-secondary);

  transition: background var(--transition), border-color var(--transition);

  user-select: none;

}

.sources-pill-trigger::-webkit-details-marker {

  display: none;

}

.sources-pill-trigger::marker {

  content: "";

}

.sources-pill-trigger:hover {

  background: var(--border-light);

  border-color: var(--border);

}

.sources-pill[open] .sources-pill-trigger {

  margin-bottom: 8px;

  border-radius: 14px;

}

.sources-favicons {

  display: inline-flex;

  align-items: center;

  flex-shrink: 0;

}

.sources-favicon {

  width: 18px;

  height: 18px;

  border-radius: 50%;

  border: 2px solid var(--bg-secondary);

  background: var(--bg);

  object-fit: cover;

  margin-left: calc(var(--stack, 0) * -7px);

}

.sources-favicon:first-child {

  margin-left: 0;

}

.sources-pill-label {

  color: var(--text);

  font-weight: 600;

}

.sources-pill-count {

  display: none;

}

.sources-panel {

  display: flex;

  flex-direction: column;

  gap: 2px;

  padding: 6px;

  border-radius: 12px;

  background: var(--bg);

  border: 1px solid var(--border);

  max-width: min(100%, 520px);

  max-height: 340px;

  overflow-y: auto;

}

.sources-row {

  display: flex;

  align-items: center;

  gap: 10px;

  padding: 8px 10px;

  border-radius: 8px;

  text-decoration: none;

  color: inherit;

  transition: background var(--transition);

  width: 100%;

  border: 0;

  background: transparent;

  font: inherit;

  text-align: left;

  cursor: pointer;

}

.sources-row:hover {

  background: var(--bg-secondary);

}

.sources-row.is-static {

  cursor: default;

}

.sources-row-icon,

.sources-row-fallback {

  flex: 0 0 16px;

  width: 16px;

  height: 16px;

  border-radius: 4px;

}

.sources-row-fallback {

  background: var(--border);

}

.sources-row-text {

  min-width: 0;

  display: flex;

  flex-direction: column;

  gap: 1px;

}

.sources-row-title {

  font-size: 13px;

  font-weight: 500;

  color: var(--text);

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;

}

.sources-row-host {

  font-size: 11.5px;

  color: var(--text-secondary);

}

.composer-send {

  display: flex;

  align-items: center;

  gap: 6px;

  margin-left: 10px;

  flex-shrink: 0;

}

.send-btn,

.voice-btn,

.stop-btn {

  display: flex;

  align-items: center;

  justify-content: center;

  width: 40px;

  height: 40px;

  border-radius: var(--radius-full);

  transition: background var(--transition), opacity var(--transition);

}

.voice-btn {
  position: relative;
  background: transparent;
  color: var(--text-secondary);
  transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
}

.voice-btn:active {
  transform: scale(0.96);
}

.voice-btn:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.voice-btn.is-recording {
  background: color-mix(in srgb, #e05252 12%, transparent);
  color: #d94646;
}

.voice-icon-cancel,
.send-icon-confirm {
  display: none;
}

.voice-btn.is-recording .voice-icon-mic,
.send-btn.is-voice-confirm .send-icon-arrow,
.composer.is-voice-recording .send-icon-arrow {
  display: none;
}

.voice-btn.is-recording .voice-icon-cancel,
.send-btn.is-voice-confirm .send-icon-confirm,
.composer.is-voice-recording .send-icon-confirm {
  display: block;
}

/* Recording must beat .hidden — mobile web stacks send/stop in one corner. */
.composer.is-voice-recording .stop-btn {
  display: none !important;
  pointer-events: none !important;
}
.composer.is-voice-recording .send-btn {
  display: flex !important;
}

.voice-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e05252;
  opacity: 0;
  transform: scale(0.92);
}

.voice-btn.is-recording .voice-dot {
  display: none;
}

.voice-btn.is-processing .voice-dot {
  opacity: 1;
  width: 9px;
  height: 9px;
  top: 6px;
  right: 6px;
  border: 1.5px solid color-mix(in srgb, var(--text-secondary) 30%, transparent);
  border-top-color: var(--text-secondary);
  background: transparent;
  animation: voice-spin 650ms linear infinite;
}

@keyframes voice-pulse {
  50% { opacity: 0.42; transform: scale(0.88); }
}

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

@media (hover: hover) and (pointer: fine) {
  .voice-btn:hover:not(:disabled) { background: var(--hover); color: var(--text); }
  .voice-btn.is-recording:hover { background: color-mix(in srgb, #e05252 16%, transparent); color: #d94646; }
}

@media (prefers-reduced-motion: reduce) {
  .voice-btn,
  .voice-dot { transition-duration: 0ms; }
  .voice-btn.is-recording .voice-dot,
  .voice-btn.is-processing .voice-dot { animation: none; }
}

.send-btn {

  background: var(--accent);

  color: var(--accent-contrast);

  opacity: 0.3;

  transform: translateY(0);

  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--accent-contrast) 28%, transparent),
    inset 0 -2px 4px color-mix(in srgb, #000 18%, transparent),
    0 1px 0 color-mix(in srgb, var(--accent) 45%, #000);

  transition:
    transform var(--motion-medium) var(--ease-out),
    box-shadow var(--motion-medium) var(--ease-out),
    opacity var(--transition),
    background var(--transition);

}

.send-btn.active {

  opacity: 1;

  transform: translateY(-3px);

  box-shadow:
    inset 0 1.5px 0 color-mix(in srgb, var(--accent-contrast) 32%, transparent),
    inset 0 -2px 4px color-mix(in srgb, #000 16%, transparent),
    0 6px 0 color-mix(in srgb, var(--accent) 52%, #000),
    0 9px 14px color-mix(in srgb, #000 24%, transparent);

}

.send-btn.active:hover {

  background: var(--accent-hover);

}

.send-btn.active:active {

  transform: translateY(4px);

  box-shadow:
    inset 0 2px 4px color-mix(in srgb, #000 22%, transparent),
    0 1px 0 color-mix(in srgb, var(--accent) 45%, #000),
    0 2px 4px color-mix(in srgb, #000 16%, transparent);

  transition-duration: 90ms;

}

/* Light: same lift, lip almost the button color. Mixing ~half black reads as a navy slab. */
body:not([data-mode="dark"]):not(.capacitor-native) .send-btn {

  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--accent-contrast) 22%, transparent),
    inset 0 -1px 2px color-mix(in srgb, #000 8%, transparent),
    0 1px 0 color-mix(in srgb, var(--accent) 88%, #000);

}

body:not([data-mode="dark"]):not(.capacitor-native) .send-btn.active {

  box-shadow:
    inset 0 1.5px 0 color-mix(in srgb, var(--accent-contrast) 28%, transparent),
    inset 0 -1px 2px color-mix(in srgb, #000 7%, transparent),
    0 6px 0 color-mix(in srgb, var(--accent) 86%, #000),
    0 9px 14px color-mix(in srgb, #000 12%, transparent);

}

body:not([data-mode="dark"]):not(.capacitor-native) .send-btn.active:active {

  box-shadow:
    inset 0 2px 4px color-mix(in srgb, #000 10%, transparent),
    0 1px 0 color-mix(in srgb, var(--accent) 88%, #000),
    0 2px 4px color-mix(in srgb, #000 8%, transparent);

}

.send-btn:disabled {

  cursor: not-allowed;

}

body.capacitor-native .send-btn {

  transform: none;

  box-shadow: none;

}

.stop-btn {

  background: var(--accent);

  color: var(--accent-contrast);

}

.stop-btn:hover {

  background: var(--accent-hover);

}

/* ─── Model selector (inside composer) ─── */

.composer-model-wrap {

  position: relative;

  flex-shrink: 1;

  min-width: 0;

  max-width: min(320px, 42vw);

  z-index: 5;

}

.composer-model-wrap.is-open {

  z-index: 50;

}

.composer-model-btn {

  display: inline-flex;

  align-items: center;

  gap: 7px;

  max-width: 100%;

  height: 38px;

  padding: 0 14px;

  border-radius: var(--radius-full);

  font-size: 14px;

  font-weight: 600;

  color: var(--text);

  background: var(--bg);

  border: 1px solid var(--border-light);

  transition: background var(--transition), border-color var(--transition);

}

.composer-model-btn.has-brand-logo {

  padding-left: 8px;

}

.composer-model-logo {

  flex-shrink: 0;

  width: 22px;

  height: 22px;

  object-fit: contain;

  border-radius: 5px;

}

.composer-model-btn:hover {

  background: var(--bg-secondary);

  border-color: var(--border);

}

.composer-model-btn.pro-active,

.compare-btn.active,

.compare-btn.council-active {

  background: color-mix(in srgb, var(--accent) 10%, var(--bg-secondary));

  border-color: var(--text);

  color: var(--text);

}

.composer-model-btn.pro-active:hover,

.compare-btn.active:hover,

.compare-btn.council-active:hover {

  background: color-mix(in srgb, var(--accent) 15%, var(--bg-secondary));

  border-color: var(--text);

  color: var(--text);

}

.composer-model-btn.pro-active .composer-model-chevron {

  color: var(--text-tertiary);

}

.composer-model-btn.pro-active .composer-model-price {

  background: color-mix(in srgb, currentColor 14%, transparent);

}

.composer-model-label {

  min-width: 0;

  overflow: hidden;

  text-overflow: ellipsis;

  white-space: nowrap;

}

.composer-model-price {

  display: inline-flex;

  align-items: center;

  justify-content: center;

  padding: 1px 6px;

  border-radius: var(--radius-full);

  background: rgba(255, 255, 255, 0.18);

  color: currentColor;

  font-size: 10px;

  font-weight: 700;

  line-height: 1.4;

}

.composer-model-chevron {

  flex-shrink: 0;

  color: var(--text-tertiary);

}

.composer-model-dropdown {

  position: absolute;

  bottom: calc(100% + 8px);

  left: 0;

  width: max-content;

  max-width: min(320px, calc(100vw - 48px));

  padding: 6px;

  background: var(--bg);

  border: 1px solid var(--border);

  border-radius: var(--radius);

  box-shadow: var(--shadow-lg);

  z-index: 50;

}

.composer-model-dropdown input {

  width: 100%;

  padding: 11px 12px;

  border: 1px solid var(--border);

  border-radius: 9px;

  background: var(--bg-secondary);

  color: var(--text);

  font-size: 15px;

  outline: none;

}

.composer-model-dropdown input:focus {

  border-color: #c8c8c8;

}

.model-catalog {

  display: flex;

  flex-direction: column;

  gap: 4px;

  margin-top: 0;

  max-height: min(420px, 46vh);

  overflow-y: auto;

}

.composer-model-dropdown .model-catalog {

  gap: 2px;

}

.model-option {

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 10px;

  width: 100%;

  padding: 11px 12px;

  border-radius: 8px;

  text-align: left;

  font-size: 15px;

  font-weight: 500;

  color: var(--text);

  transition: background var(--transition);

}

.model-option-main {

  display: flex;

  align-items: center;

  gap: 10px;

  min-width: 0;

  flex: 1;

}

.model-option-logo {

  flex-shrink: 0;

  width: 24px;

  height: 24px;

  object-fit: contain;

  border-radius: 5px;

}

.model-option-logo-placeholder {

  flex-shrink: 0;

  width: 24px;

  height: 24px;

}

.mode-option {

  align-items: flex-start;

  padding: 8px 10px;

  gap: 8px;

}

.model-option-copy {

  display: flex;

  flex-direction: column;

  gap: 2px;

  min-width: 0;

}

.model-option-desc {

  color: var(--text-tertiary);

  font-size: 12px;

  line-height: 1.3;

}

.model-price-note {

  display: inline-flex;

  align-items: center;

  justify-content: center;

  margin-left: 5px;

  padding: 1px 5px;

  border-radius: var(--radius-full);

  background: var(--accent);

  color: var(--accent-contrast);

  font-size: 10px;

  font-weight: 700;

  vertical-align: 1px;

}

.model-option:hover,

.model-option.active {

  background: var(--bg-secondary);

}

.model-option-name {

  min-width: 0;

  overflow: hidden;

  text-overflow: ellipsis;

  white-space: nowrap;

}

.model-option-check {

  flex-shrink: 0;

  width: 1.1em;

  font-size: 13px;

  color: var(--text);

  text-align: right;

}

.model-empty {

  padding: 14px 10px;

  color: var(--text-tertiary);

  font-size: 13px;

  text-align: center;

}

/* ─── Compare selector ─── */

.composer-compare-wrap {

  position: relative;

  flex-shrink: 0;

  z-index: 5;

}

.composer-compare-wrap.is-open {

  z-index: 50;

}

.compare-btn {

  display: inline-flex;

  align-items: center;

  gap: 6px;

  height: 38px;

  padding: 0 12px;

  border-radius: var(--radius-full);

  font-size: 14px;

  font-weight: 600;

  color: var(--text-secondary);

  background: var(--bg);

  border: 1px solid var(--border-light);

  transition: background var(--transition), border-color var(--transition), color var(--transition);

}

.compare-btn:hover {

  background: var(--bg-secondary);

  border-color: var(--border);

  color: var(--text);

}

.compare-dropdown {

  position: absolute;

  bottom: calc(100% + 8px);

  left: 0;

  width: min(420px, calc(100vw - 48px));

  padding: 10px;

  background: var(--bg);

  border: 1px solid var(--border);

  border-radius: var(--radius);

  box-shadow: var(--shadow-lg);

  z-index: 50;

}

.compare-dropdown input {

  width: 100%;

  padding: 11px 12px;

  border: 1px solid var(--border);

  border-radius: 9px;

  background: var(--bg-secondary);

  color: var(--text);

  font-size: 15px;

  outline: none;

}

.compare-dropdown input:focus {

  border-color: #c8c8c8;

}

.compare-hint {

  padding: 8px 2px 2px;

  color: var(--text-tertiary);

  font-size: 12px;

  font-weight: 600;

}

.compare-mode-toggle {

  display: inline-flex;

  margin: 8px 0 6px;

  padding: 3px;

  background: var(--bg-secondary);

  border: 1px solid var(--border-light);

  border-radius: var(--radius-full);

  gap: 2px;

}

.compare-mode-seg {

  display: inline-flex;

  align-items: center;

  gap: 6px;

  padding: 5px 12px;

  border-radius: var(--radius-full);

  font-size: 12.5px;

  font-weight: 600;

  color: var(--text-secondary);

  transition: background var(--transition), color var(--transition);

}

.compare-mode-seg:hover {

  color: var(--text);

}

.compare-mode-seg.active {

  background: var(--bg);

  color: var(--text);

  box-shadow: var(--shadow-sm);

}

.compare-mode-desc {

  padding: 0 2px 6px;

  color: var(--text-tertiary);

  font-size: 11.5px;

  line-height: 1.4;

}

.compare-option.disabled {

  opacity: 0.42;

}

.compare-clear {

  width: 100%;

  height: 34px;

  margin-top: 8px;

  border-radius: 8px;

  color: var(--text-secondary);

  background: var(--bg-secondary);

  font-size: 13px;

  font-weight: 600;

  transition: background var(--transition), color var(--transition);

}

.compare-clear:hover {

  background: var(--bg-secondary);

  color: var(--text);

}
