.input-bar {
  position: relative;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.375rem;
  width: min(100% - 2 * var(--gutter), var(--column));
  margin: 0 auto calc(1.75rem + var(--safe-bottom));
  padding: 0.375rem;
  border-radius: 1rem;
  background: var(--card, #fff);
  box-shadow: 0 0.25rem 1.25rem rgba(7, 20, 51, 0.08);
}
.input-bar {
  --tool: var(--tap);
}
@media (min-width: 769px) {
  .input-bar {
    --tap: 2.25rem;
    --tool: 1.75rem;
  }
}
.input-drop-zone {
  position: relative;
  display: grid;
  gap: 0.375rem;
  min-width: 0;
}
.input-drop-zone.is-dragging::before {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px dashed var(--accent-periwinkle, #8f9bdc);
  border-radius: 10px;
  background: rgba(172, 183, 255, 0.08);
  pointer-events: none;
  z-index: 10;
}
.drop-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  z-index: 15;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-periwinkle, #8f9bdc);
}
.bar-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.bar-row.primary-row {
  position: relative;
  min-width: 0;
  flex-wrap: wrap;
  align-items: flex-end;
  row-gap: 0.25rem;
}
.primary-row .input-wrapper {
  display: contents;
}
.primary-row textarea,
.primary-row .clear-input-btn,
.primary-row .cancel-edit-btn {
  order: 1;
}
.primary-row .mic-btn,
.primary-row > button:last-child {
  order: 2;
}
.bar-row.primary-row::after {
  content: "";
  order: 3;
  flex: 0 0 100%;
}
.primary-row .attach-area,
.primary-row .advanced-btn,
.primary-row .cache-btn,
.primary-row .model-area,
.primary-row .pursue-area {
  order: 4;
}
.primary-row textarea {
  flex: 1 1 0;
  min-width: 0;
  min-height: var(--tap);
  max-height: 40dvh;
  padding: calc((var(--tap) - 1.4em) / 2) 0.5rem;
  border: none;
  border-radius: 0.625rem;
  background: transparent;
  font-family: inherit;
  font-size: max(16px, 1rem);
  line-height: 1.4;
  resize: none;
  overflow-y: hidden;
}
.primary-row textarea.has-overflow {
  overflow-y: auto;
}
.primary-row textarea:focus {
  outline: none;
}
.primary-row textarea::placeholder {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.primary-row textarea:disabled {
  cursor: default;
  opacity: 0.6;
}
.primary-row textarea.at-limit {
  color: #c43d3d;
}
.input-bar:has(.input-wrapper.edit-mode) {
  box-shadow: 0 0 0 1px rgba(245, 158, 66, 0.35), 0 0.25rem 1.25rem rgba(7, 20, 51, 0.08);
}
.input-bar:has(.input-wrapper.transcribing-mode) {
  animation: transcribe-pulse 1.5s ease-in-out infinite;
}
@keyframes transcribe-pulse {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.2), 0 0.25rem 1.25rem rgba(7, 20, 51, 0.08);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.45), 0 0.25rem 1.25rem rgba(7, 20, 51, 0.08);
  }
}
.primary-row .attach-area {
  margin-right: auto;
}
.clear-input-btn,
.cancel-edit-btn {
  align-self: flex-start;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin: 0.25rem 0 0;
  padding: 0;
  border: none;
  border-radius: 0.375rem;
  background: transparent;
  cursor: pointer;
}
.cancel-edit-btn {
  font-size: 18px;
  font-weight: 300;
  color: rgba(var(--ink-rgb), 0.4);
}
.cancel-edit-btn:hover {
  background: rgba(245, 158, 66, 0.1);
  color: rgba(var(--ink-rgb), 0.7);
}
.clear-input-icon {
  width: 14px;
  height: 14px;
  opacity: 0.5;
}
.clear-input-btn:hover .clear-input-icon {
  opacity: 0.7;
}
.attach-area {
  position: relative;
  display: flex;
  flex-shrink: 0;
}
.attach-btn,
.mic-btn,
.model-chip {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: none;
  border-radius: 0.625rem;
  background: transparent;
  cursor: pointer;
}
.attach-btn,
.model-chip {
  width: var(--tool);
  height: var(--tool);
  border-radius: 0.5rem;
}
.attach-btn:hover,
.mic-btn:hover:not(:disabled),
.model-chip:hover {
  background: rgba(var(--ink-rgb), 0.05);
}
.attach-icon {
  width: 1.125rem;
  height: 1.125rem;
}
.mic-icon {
  width: 1.5rem;
  height: 1.5rem;
}
.attach-icon {
  opacity: 0.45;
}
.attach-btn:hover .attach-icon {
  opacity: 0.7;
}
.mic-icon {
  color: var(--muted);
}
.mic-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.mic-btn.recording {
  background: rgba(210, 50, 50, 0.08);
  box-shadow: 0 0 0 1px rgba(210, 50, 50, 0.5);
  animation: mic-pulse 1.4s ease-in-out infinite;
}
.mic-btn.recording .mic-icon {
  color: #d03232;
}
@keyframes mic-pulse {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(210, 50, 50, 0.5), 0 0 0 0 rgba(210, 50, 50, 0.3);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(210, 50, 50, 0.5), 0 0 0 7px rgba(210, 50, 50, 0);
  }
}
.primary-row > button:last-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: var(--tap);
  padding: 0 0.875rem;
  border: 1px solid rgba(var(--ink-rgb), 0.12);
  border-radius: 0.625rem;
  background: rgba(255, 255, 255, 0.08);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  color: rgba(var(--ink-rgb), 0.9);
  cursor: pointer;
  transition: background 180ms ease;
}
.primary-row > button:last-child:hover:not(:disabled) {
  background: rgba(var(--ink-rgb), 0.04);
  border-color: rgba(var(--ink-rgb), 0.18);
}
.primary-row:has(> button:last-child:not(:disabled)) .mic-btn:not(.recording) {
  display: none;
}
.primary-row > button:last-child:disabled {
  display: none;
}
.advanced-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  flex: 0 0 auto;
  min-width: var(--tool);
  height: var(--tool);
  padding: 0 0.5rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  font: inherit;
  font-size: 0.8125rem;
  color: rgba(var(--ink-rgb), 0.55);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.advanced-btn:hover:not(:disabled) {
  color: rgba(var(--ink-rgb), 0.8);
  background: rgba(var(--ink-rgb), 0.05);
}
.advanced-btn.on {
  color: #7a4f12;
  background: rgba(237, 197, 130, 0.3);
}
.advanced-btn.on .advanced-icon {
  fill: rgba(237, 186, 98, 0.85);
}
.advanced-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.advanced-icon {
  flex: 0 0 auto;
  width: 1.125rem;
  height: 1.125rem;
}
.cache-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  flex: 0 0 auto;
  min-width: var(--tool);
  height: var(--tool);
  padding: 0 0.5rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  font: inherit;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  color: rgba(var(--ink-rgb), 0.55);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.cache-btn:hover:not(:disabled) {
  color: rgba(var(--ink-rgb), 0.8);
  background: rgba(var(--ink-rgb), 0.05);
}
.cache-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.cache-icon {
  flex: 0 0 auto;
  width: 1.125rem;
  height: 1.125rem;
}
.cache-track {
  stroke: rgba(var(--ink-rgb), 0.18);
}
.cache-ring {
  stroke: transparent;
  transition: stroke-dashoffset 1s linear, stroke 200ms ease;
}
.cache-hand {
  stroke: currentColor;
}
.cache-btn.warm .cache-ring {
  stroke: rgba(74, 140, 92, 0.85);
}
.cache-btn.ending .cache-ring {
  stroke: rgba(214, 150, 52, 0.95);
}
.model-area {
  position: relative;
  flex: 0 0 auto;
}
.model-chip img {
  width: 1.125rem;
  height: 1.125rem;
}
.pursue-area {
  position: relative;
  flex: 0 0 auto;
}
.pursue-btn {
  min-width: var(--tool);
  min-height: var(--tool);
  padding: 0 0.5rem;
  border: 1px solid rgba(var(--ink-rgb), 0.12);
  border-radius: 0.5rem;
  background: transparent;
  font: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), 0.45);
  cursor: pointer;
  transition:
    color 120ms ease,
    border-color 120ms ease,
    background-color 120ms ease;
}
.pursue-btn:hover:not(:disabled) {
  color: rgba(var(--ink-rgb), 0.75);
  border-color: rgba(var(--ink-rgb), 0.2);
}
.pursue-btn.armed {
  color: #8a6520;
  border-color: rgba(184, 134, 63, 0.45);
  background: rgba(184, 134, 63, 0.08);
}
.pursue-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.pursue-menu,
.selector-panel {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding: 6px;
  background: var(--card, #fff);
  border: 1px solid rgba(var(--ink-rgb), 0.1);
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
}
.pursue-menu {
  width: 13rem;
}
.pursue-menu-label,
.pursue-menu-note {
  padding: 4px 8px;
  font-size: 0.6875rem;
  color: rgba(var(--ink-rgb), 0.4);
}
.pursue-menu-note {
  margin-top: 4px;
  padding-top: 7px;
  border-top: 1px solid rgba(var(--ink-rgb), 0.07);
  line-height: 1.45;
}
.pursue-menu-item {
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font: inherit;
  font-size: 0.8125rem;
  text-align: left;
  color: rgba(var(--ink-rgb), 0.8);
  cursor: pointer;
}
.pursue-menu-item:hover {
  background: rgba(var(--ink-rgb), 0.06);
}
.pursue-menu-item.is-on {
  color: #8a6520;
  font-weight: 600;
}
.selector-panel {
  gap: 0.625rem;
  min-width: 14rem;
  padding: 1.25rem 0.625rem 0.875rem;
}
.panel-header {
  position: absolute;
  top: 4px;
  right: 4px;
}
.panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
}
.panel-close:hover {
  color: #1e90ff;
}
.model-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.model-icon {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 2.25rem;
  padding: 4px 6px;
  border: 1px solid rgba(var(--ink-rgb), 0.08);
  border-radius: 6px;
  background: var(--card);
  cursor: pointer;
  transition: border-color 120ms ease;
}
.model-icon img {
  display: block;
  width: 14px;
  height: 14px;
  object-fit: contain;
}
.model-icon .model-name {
  font-size: 0.6rem;
  line-height: 1;
  letter-spacing: 0.02em;
  color: rgba(var(--ink-rgb), 0.55);
}
.model-icon:hover:not(.disabled) {
  border-color: rgba(var(--ink-rgb), 0.2);
}
.model-icon.active {
  border-color: rgba(var(--ink-rgb), 0.3);
  background: rgba(var(--ink-rgb), 0.05);
}
.model-icon.active .model-name {
  color: rgba(var(--ink-rgb), 0.85);
}
.model-icon.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.mode-row {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
}
.mode-item {
  display: inline-flex;
  align-items: center;
}
.mode-text {
  margin: 0;
  padding: 0.375rem 0.5rem;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
}
.mode-text:hover:not(.disabled),
.mode-text.active {
  color: #1e90ff;
}
.mode-text:focus {
  outline: none;
}
.mode-text.disabled {
  color: rgba(var(--ink-rgb), 0.3);
  cursor: not-allowed;
}
.mode-separator {
  color: rgba(var(--ink-rgb), 0.25);
  font-weight: 300;
  user-select: none;
}
.mode-description {
  margin-top: -0.375rem;
  font-size: 0.6875rem;
  font-style: italic;
  text-align: center;
  color: rgba(var(--ink-rgb), 0.4);
}
.recording-indicator {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(14, 16, 28, 0.92);
  border: 1px solid rgba(210, 50, 50, 0.22);
  border-radius: 20px;
  white-space: nowrap;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.22);
  pointer-events: none;
  z-index: 60;
}
.recording-spinner {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(232, 234, 242, 0.2);
  border-top-color: rgba(232, 234, 242, 0.75);
  animation: spinner-turn 0.8s linear infinite;
}
@keyframes spinner-turn {
  to {
    transform: rotate(360deg);
  }
}
.recording-label {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(232, 234, 242, 0.9);
}
.artifacts-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  padding: 0 0.25rem;
}
.artifact-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  min-height: 2rem;
  padding: 0 6px 0 4px;
  border: 1px solid rgba(var(--ink-rgb), 0.1);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.8125rem;
  color: rgba(var(--ink-rgb), 0.75);
  overflow: hidden;
}
.artifact-preview {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 2px;
  overflow: hidden;
}
.artifact-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.artifact-icon {
  flex-shrink: 0;
  font-size: 11px;
  line-height: 1;
}
.artifact-label {
  flex: 1;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artifact-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin-left: auto;
  padding: 0;
  border: none;
  border-radius: 2px;
  background: transparent;
  font-size: 14px;
  line-height: 1;
  color: rgba(var(--ink-rgb), 0.4);
  cursor: pointer;
}
.artifact-remove:hover {
  color: rgba(var(--ink-rgb), 0.7);
  background: rgba(var(--ink-rgb), 0.06);
}
.artifact-pill.attachment-pending {
  opacity: 0.7;
  border-style: dashed;
}
.artifact-pill.attachment-uploading {
  opacity: 0.8;
}
.artifact-pill.attachment-ready {
  border-color: rgba(131, 216, 245, 0.3);
}
.artifact-pill.attachment-error {
  border-color: rgba(220, 53, 69, 0.3);
  background: rgba(220, 53, 69, 0.05);
}
.artifact-pill.had-attachment-reminder {
  flex: 0 0 auto;
  max-width: none;
  border-color: rgba(180, 80, 80, 0.25);
  background: rgba(180, 80, 80, 0.06);
  color: rgba(140, 60, 60, 0.85);
}
.had-attachment-reminder-icon {
  width: 12px;
  height: 12px;
  opacity: 0.7;
  color: #b06040;
}
.credit-footer {
  position: absolute;
  top: calc(100% + 0.375rem);
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 8px;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  color: rgba(var(--ink-rgb), 0.42);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.credit-footer.insufficient {
  color: #b3524f;
}
.credit-add {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.signin-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.primary-row textarea:disabled {
  pointer-events: none;
}
.read-only-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: rgba(var(--ink-rgb), 0.55);
}
.read-only-note button {
  padding: 0.25rem 0.75rem;
  border: 1px solid rgba(var(--ink-rgb), 0.15);
  border-radius: 999px;
  background: transparent;
  font: inherit;
  color: rgba(var(--ink-rgb), 0.8);
  cursor: pointer;
}
