/* One chat composer for Crew, direct, company, job, and Home Ask Nico.
   Left to right: photo, paperclip, voice, message, send. Those three icons
   are a 36px group with the glyph unchanged, touching each other, and
   centered on the field and the 44px send button. The message field grows
   into the space that frees up. */
.tk-chat-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  margin: 0;
  position: relative;
}
.tk-chat-line > .photo-attach { display: contents; }
.tk-chat-line .photo-attach-list,
.tk-chat-line .photo-attach-status {
  flex: 1 0 100%;
  order: -1;
  margin: 0;
}
.tk-chat-line .photo-attach-list[hidden],
.tk-chat-line .photo-attach-status[hidden],
.tk-chat-queue[hidden],
.tk-chat-status[hidden] { display: none !important; }
.tk-chat-line > .tk-chat-tool,
.tk-chat-line > .photo-attach-add,
.tk-chat-line > button.tk-chat-tool,
.tk-chat-line .photo-attach-add.photo-attach-icon,
.tk-chat-line > .tk-chat-send,
.tk-chat-line > .crew-send,
.tk-chat-line > .daily-send {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink, #111111);
  font-size: 0;
  line-height: 1;
  cursor: pointer;
}
.tk-chat-line > .tk-chat-tool,
.tk-chat-line > button.tk-chat-tool,
.tk-chat-line .photo-attach-add.photo-attach-icon,
.crew-dialog .tk-chat-line > label.tk-chat-tool,
.crew-dialog .tk-chat-line > button.crew-icon {
  flex: 0 0 36px;
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  padding: 0 !important;
}
.tk-chat-line > .tk-chat-send,
.tk-chat-line > .crew-send,
.tk-chat-line > .daily-send {
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
}
.tk-chat-line > .tk-chat-send,
.tk-chat-line > .crew-send,
.tk-chat-line > .daily-send,
.tk-chat-line > #ai-send {
  background: var(--red, #C41E3A);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
}
.tk-chat-line > .tk-chat-send:disabled,
.tk-chat-line > .crew-send:disabled,
.tk-chat-line > .daily-send:disabled,
.tk-chat-line > #ai-send:disabled {
  background: #DDE2E8;
  color: var(--ink-dim, #5c6670);
  opacity: 1;
}
.tk-chat-tool { position: relative; }
.tk-chat-tool svg,
.tk-chat-line .photo-attach-add svg,
.tk-chat-line .crew-icon svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tk-chat-file,
.tk-chat-line input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: 0;
}
.tk-chat-tool:focus-within,
.tk-chat-line > button:focus-visible,
.tk-chat-line > textarea:focus-visible {
  outline: 3px solid var(--red, #C41E3A);
  outline-offset: 2px;
}
.tk-chat-line > textarea,
.tk-chat-line > #ai-text,
.tk-chat-line > #crew-compose-text,
.tk-chat-line > #daily-message {
  flex: 1 1 96px;
  width: auto;
  min-width: 0;
  height: 44px;
  min-height: 44px !important;
  max-height: 120px !important;
  margin: 0;
  padding: 10px 12px;
  box-sizing: border-box;
  border: 1px solid var(--control-line, var(--line, #d9dee3));
  border-radius: 18px;
  background: #fff;
  color: var(--ink, #111);
  font: inherit;
  font-size: 16px;
  line-height: 22px;
  resize: none;
  grid-column: auto;
  grid-row: auto;
}
.tk-chat-status { margin: 0 0 6px; font-size: 14px; line-height: 1.4; color: var(--ink-dim, #505b67); }
.tk-chat-status.tk-chat-error { color: var(--warn-dim, #8a5a00); }
.tk-chat-queue { display: flex; flex-wrap: wrap; gap: 8px; max-height: 132px; margin: 0 0 8px; padding: 0; overflow: auto; list-style: none; }
.tk-chat-queue li { display: flex; align-items: center; gap: 4px; min-width: 0; }
.tk-chat-queue img,
.tk-chat-fallback {
  display: block;
  width: 56px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  background: #eee;
}
.tk-chat-chip {
  display: block;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 44px;
  padding: 0 8px;
  border-radius: 8px;
  background: #f3f4f6;
  color: #111;
}
.tk-chat-remove {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-size: 20px;
  line-height: 1;
}
.photo-attach-add.photo-attach-icon {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  gap: 0;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
}
.photo-attach-add.photo-attach-icon .photo-attach-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
/* Job and Home inherit older row rules. These win so every icon, the field,
   and Send share one center line. */
body.job-centered #ai-workspace #ai-composer .composer-message-row { align-items: stretch; }
body.job-centered #ai-workspace #ai-composer .composer-action-row.tk-chat-line {
  display: flex;
  align-items: center;
  gap: 8px;
}
body.job-centered #ai-workspace #ai-composer .tk-chat-line > #ai-text {
  height: 44px !important;
  min-height: 44px !important;
  max-height: 120px !important;
  width: auto !important;
  padding: 10px 12px !important;
}
body.job-centered #ai-workspace #ai-composer .tk-chat-line > #ai-record,
body.job-centered #ai-workspace #ai-composer .tk-chat-line > .photo-attach-add,
body.job-centered #ai-workspace #ai-composer .tk-chat-line .photo-attach-add.photo-attach-icon,
body.job-centered #ai-workspace #ai-composer .tk-chat-line > .tk-chat-tool {
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 0 !important;
  overflow: hidden;
  position: relative;
}
body.job-centered #ai-workspace #ai-composer .tk-chat-line > #ai-record > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
body.job-centered #ai-workspace #ai-composer .tk-chat-line > #ai-send {
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 50% !important;
  font-size: 0 !important;
}
body.job-centered #ai-workspace #ai-composer .tk-chat-line > #ai-send::after {
  content: '↑' !important;
  display: inline !important;
  font: 700 22px/1 system-ui, sans-serif;
}
#daily-compose .daily-compose-row.tk-chat-line {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  border: 0;
}
#daily-compose .photo-attach-add { order: 1; }
#daily-compose .tk-chat-line > label.tk-chat-tool { order: 2; }
#daily-compose #home-compose-voice { order: 3; }
#daily-compose #daily-message {
  order: 4;
  flex: 1 1 96px;
  height: 44px;
  min-height: 44px !important;
  max-height: 168px !important;
}
#daily-compose #daily-continue {
  order: 5;
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 50% !important;
  font-size: 22px !important;
}
/* The row gap stays 8px so Voice, the field, and Send keep breathing room.
   Photo and paperclip cancel that gap, so the three icons touch. The
   field's flex-grow takes the extra space. The glyph stays 22px. */
.tk-chat-line > label.tk-chat-tool,
.tk-chat-line .photo-attach-add.photo-attach-icon,
.crew-dialog .tk-chat-line > label.tk-chat-tool,
body.job-centered #ai-workspace #ai-composer .tk-chat-line > label.tk-chat-tool,
body.job-centered #ai-workspace #ai-composer .tk-chat-line .photo-attach-add.photo-attach-icon,
#daily-compose .tk-chat-line > label.tk-chat-tool,
#daily-compose .photo-attach-add.photo-attach-icon {
  margin-right: -8px !important;
}
.daily-home .daily-compose-row textarea { min-height: 44px !important; max-height: 168px !important; }
/* 320px leaves about 100px for the placeholder, which wraps to five lines. */
@media (max-width: 360px) {
  #daily-compose #daily-message { min-height: 152px !important; }
}
