/* Send work: the conversation, the composer, the plan and the review and share dialogs. */

/* ---------- Conversation ---------- */
.sam-message { display: flex; gap: 12px; margin: 26px 0; align-items: flex-start; animation: msgIn .55s var(--ease) both; }
.sam-message > .sam-face { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; object-fit: cover; border: 1px solid var(--line-3); background: var(--card); }
.sam-message-body { min-width: 0; flex: 1; color: var(--text-2); font-size: 15px; line-height: 1.7; }
.sam-message-body > p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.sam-message-body > .sam-name { display: flex; align-items: center; gap: 8px; margin: 6px 0 6px; font-size: 13px; font-weight: 560; letter-spacing: -.01em; color: var(--text); line-height: 1.2; }
.sam-name .sam-role { font-weight: 400; color: var(--faint); font-size: 12px; }
.sam-user-message {
  width: fit-content;
  max-width: min(560px, 86%);
  margin: 22px 0 22px auto;
  padding: 12px 16px;
  border-radius: 16px 16px 5px 16px;
  background: var(--card-2);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  animation: msgIn .45s var(--ease) both;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sam-message-body .inline-action { margin-top: 12px; }
.sam-message.continued { margin-top: -10px; }
.sam-message.continued > .sam-face { visibility: hidden; height: 0; }
.sam-message.continued .sam-name { display: none; }

/* Empty state: a new request */
.work-greeting { padding: 40px 0 8px; max-width: 600px; }
.work-greeting .work-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-3); }
.work-greeting h1 { margin: 10px 0 12px; font-size: clamp(1.75rem, 1.4rem + 1vw, 2.25rem); line-height: 1.1; font-weight: 500; letter-spacing: -.04em; }
.work-greeting > p:not(.eyebrow) { font-size: 15px; line-height: 1.7; color: var(--muted); max-width: 54ch; }
.work-greeting > .eyebrow { margin-top: 22px; }
.how-it-works { list-style: none; margin: 26px 0 0; padding: 0; border-top: 1px solid var(--line); }
.how-it-works li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 2px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--text-2); line-height: 1.55; }
.how-it-works .num { font-family: var(--mono); font-size: 11.5px; color: var(--accent); padding-top: 2px; }
.how-it-works small { display: block; color: var(--faint); font-size: 12.5px; margin-top: 1px; }
.work-examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.work-examples .example-label { width: 100%; }
.example-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--text-2);
  font-size: 13px;
  transition: transform .3s var(--ease);
}
.example-chip .i { width: 15px; height: 15px; color: var(--faint); }
.example-chip:hover { background: var(--card-2); border-color: var(--line-3); color: var(--text); }
.example-chip:active { transform: scale(.98); }

/* ---------- Composer ---------- */
#workspace .composer {
  position: relative;
  padding: 12px 12px 10px 14px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line-2);
  box-shadow: var(--inset), 0 16px 40px -24px rgb(9 9 11 / .9);
}
#workspace .composer:focus-within { border-color: var(--line-3); box-shadow: var(--inset), 0 0 0 3px rgb(166 186 214 / .08), 0 16px 40px -24px rgb(9 9 11 / .9); }
#workspace .composer.dragover { border-color: var(--accent); background: var(--accent-soft); }
#workspace .composer textarea {
  display: block;
  width: 100%;
  min-height: 52px;
  max-height: 200px;
  padding: 10px 2px 4px;
  border: 0;
  background: transparent;
  box-shadow: none;
  resize: none;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
}
#workspace .composer textarea:focus-visible { box-shadow: none; outline: none; }
#workspace .composer textarea:disabled { opacity: .55; }
.compose-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 6px; }
.paperclip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  margin-left: -4px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: transform .3s var(--ease);
}
.paperclip .i { width: 17px; height: 17px; }
.paperclip:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.paperclip:disabled { opacity: .4; cursor: not-allowed; }
.draft-storage {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .01em;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
}
.draft-storage .i { width: 13px; height: 13px; }
.draft-storage[data-state="saving"] { color: var(--muted); }
.draft-storage[data-state="error"] { color: var(--warn); cursor: pointer; }
.draft-storage[data-state="error"]:hover { text-decoration: underline; text-underline-offset: 3px; }
.send {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 14px 0 12px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13.5px;
  font-weight: 560;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .28);
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.send .i { width: 16px; height: 16px; }
.send:hover:not(:disabled) { background: var(--accent-hi); }

/* Client and workflow tags */
.composer-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.entity-chip {
  display: inline-flex;
  align-items: stretch;
  max-width: 100%;
  min-height: 30px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: var(--card-2);
  color: var(--text);
  font-size: 13px;
  line-height: 1.3;
  overflow: hidden;
}
.entity-chip button { color: inherit; }
.entity-chip .chip-label { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 0 10px; transition: transform .3s var(--ease); }
.entity-chip .chip-label:hover { background: var(--hover); }
.entity-chip .chip-label .i { width: 15px; height: 15px; color: var(--accent); }
.chip-type { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.entity-chip .chip-remove { display: grid; place-items: center; width: 28px; border-left: 1px solid var(--line-2); color: var(--faint); }
.entity-chip .chip-remove:hover { color: var(--text); background: var(--hover); }
.entity-chip .chip-remove .i { width: 14px; height: 14px; }
.entity-chip.missing { background: transparent; border-style: dashed; border-color: var(--line-3); }
.entity-chip.missing .chip-name { color: var(--muted); font-weight: 400; }
.entity-chip.missing .chip-label .i { color: var(--faint); }
.entity-chip.invalid { border-color: var(--warn-line); }
.entity-static { display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; margin: 0 6px 6px 0; }
.entity-static .i { width: 15px; height: 15px; color: var(--accent); }
.entity-chips-inline { display: flex; flex-wrap: wrap; }

/* Suggestions */
.autocomplete {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  max-height: 340px;
  overflow: auto;
  padding: 6px;
  border-radius: 14px;
  background: #1d1d21;
  border: 1px solid var(--line-3);
  box-shadow: var(--shadow-pop);
  animation: popIn .3s var(--ease) both;
}
@keyframes popIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.suggestion-heading { padding: 10px 10px 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.suggestion-option {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  text-align: left;
  color: var(--text-2);
}
.suggestion-option[aria-selected="true"], .suggestion-option:hover { background: var(--hover); border-color: var(--line-2); color: var(--text); }
.suggestion-icon { display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px; background: var(--card); border: 1px solid var(--line-2); color: var(--accent); }
.suggestion-icon .i { width: 16px; height: 16px; }
.suggestion-option.create .suggestion-icon { color: var(--text-2); border-style: dashed; }
.suggestion-main { flex: 1; min-width: 0; }
.suggestion-main strong { display: block; font-size: 14px; font-weight: 520; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggestion-main small { display: block; margin-top: 1px; font-size: 12px; color: var(--faint); }
.autocomplete-note { padding: 8px 10px 6px; font-size: 12.5px; line-height: 1.55; color: var(--faint); }

/* Attachments */
.attachment-list { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; }
.attachment-list:empty { display: none; }
.attachment-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  min-height: 32px;
  padding: 0 4px 0 9px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: var(--card-2);
  font-size: 12.5px;
  color: var(--text-2);
  overflow: hidden;
}
.attachment-chip > .i { width: 15px; height: 15px; color: var(--faint); }
.attachment-chip .file-name { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment-chip small { font-family: var(--mono); font-size: 11px; color: var(--faint); white-space: nowrap; }
.attachment-chip button { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 6px; color: var(--faint); font-size: 12px; }
.attachment-chip button:hover { color: var(--text); background: var(--hover); }
.attachment-chip button .i { width: 13px; height: 13px; }
.attachment-chip .chip-retry { color: var(--warn); font-weight: 500; }
.attachment-chip .chip-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: transparent; }
.attachment-chip .chip-progress > span { display: block; height: 100%; background: var(--accent); transform-origin: left center; transform: scaleX(var(--p, 0)); transition: transform .3s var(--ease); }
.attachment-chip.uploading small { color: var(--accent); }
.attachment-chip.error { border-color: var(--warn-line); background: var(--warn-soft); color: #ecd2ad; }
.attachment-chip.error > .i, .attachment-chip.error small { color: var(--warn); }

.composer-error { display: flex; align-items: flex-start; gap: 8px; padding: 10px 2px 0; color: var(--warn); font-size: 13px; line-height: 1.55; }
.composer-error:empty { display: none; }
.composer-error .i { width: 15px; height: 15px; margin-top: 2px; }
.composer-error button { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; white-space: nowrap; }
.composer-error button:hover { color: var(--text); }

/* ---------- Sam's working states ---------- */
.sam-collecting > .sam-face { animation: samNod 2.4s var(--ease) both; }
.file-collect-animation { display: inline-flex; gap: 5px; margin-top: 10px; }
.file-collect-animation > span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: collectDot 1.3s ease-in-out infinite; }
.file-collect-animation > span:nth-child(2) { animation-delay: .16s; }
.file-collect-animation > span:nth-child(3) { animation-delay: .32s; }
@keyframes collectDot { 0%, 65%, 100% { opacity: .3; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-4px); } }
.collection-source { font-size: 13px !important; color: var(--faint) !important; margin-top: 6px !important; }
.collected-files { list-style: none; padding: 0; margin: 10px 0 0; }
.collected-files li { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--text-2); line-height: 1.5; }
.collected-files li:last-child { border-bottom: 0; }
.collected-files li span { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.collected-files li span .i { width: 15px; height: 15px; color: var(--faint); }
.collected-files small { font-family: var(--mono); font-size: 11px; white-space: nowrap; color: var(--faint); }
.work-validation-question { border-left: 2px solid var(--warn); padding-left: 14px; }
.work-validation-question p { color: var(--text); }

/* ---------- Plan ---------- */
.compact-plan {
  margin-top: 12px;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--line-2);
  background: var(--card);
  box-shadow: var(--inset);
}
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.plan-head .entity-chips-inline .entity-static { margin-bottom: 0; }
.compact-plan .plan-meta { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; color: var(--faint); }
.plan-collected-files { margin: 16px 0; padding: 14px 0 6px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.plan-collected-files > strong { display: block; font-family: var(--mono); font-size: 11px; font-weight: 450; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.plan-steps-title { margin: 18px 0 4px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.compact-plan ol { list-style: none; counter-reset: plan; margin: 6px 0 16px; padding: 0; }
.compact-plan ol li { counter-increment: plan; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 4px; padding: 9px 0; font-size: 14.5px; line-height: 1.55; color: var(--text); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.compact-plan ol li:last-child { border-bottom: 0; }
.compact-plan ol li::before { content: counter(plan, decimal-leading-zero); font-family: var(--mono); font-size: 11.5px; color: var(--accent); padding-top: 3px; }
.plan-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.compact-plan .plan-hint { font-size: 13px; color: var(--faint); margin: 0; }
.compact-plan .primary:disabled { opacity: 1; background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); cursor: default; }
.inline-validation { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; padding: 11px 13px; border-radius: var(--r-md); border: 1px solid var(--warn-line); background: var(--warn-soft); color: #ecd2ad; font-size: 13.5px; line-height: 1.55; }
.inline-validation .i { width: 16px; height: 16px; margin-top: 2px; color: var(--warn); }
.inline-validation button { display: block; margin-top: 8px; color: var(--text-2); text-decoration: underline; font-size: 13px; }
.inline-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 13px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 520;
  box-shadow: var(--inset);
  transition: transform .3s var(--ease);
}
.inline-action .i { width: 16px; height: 16px; color: var(--accent); }
.inline-action:hover { background: var(--hover); border-color: var(--line-3); }
.inline-action.strong { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.inline-action.strong .i { color: var(--accent-ink); }
.inline-action.strong:hover { background: var(--accent-hi); }

.work-status-card { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: start; margin-top: 4px; padding: 18px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--card); box-shadow: var(--inset); }
.work-status-card h3 { font-size: 16px; font-weight: 560; letter-spacing: -.02em; margin: 0 0 4px; color: var(--text); }
.work-status-card p { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.6; }
.work-status-card .status-steps { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.work-status-card.done { border-color: var(--accent-line); }
.review-approved-note { display: flex; align-items: center; gap: 7px; font-size: 13px !important; color: var(--muted) !important; margin-top: 10px !important; }
.review-approved-note .i { width: 15px; height: 15px; color: var(--accent); }

/* ---------- Sidebar tasks ---------- */
.task-empty { display: grid; gap: 6px; justify-items: start; padding: 10px; font-size: 12.5px; color: var(--faint); line-height: 1.55; }
.task-empty .i { width: 18px; height: 18px; color: var(--ghost); }
.sidebar-task-row { position: relative; margin-bottom: 2px; }
.sidebar-task {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  text-align: left;
  transition: transform .3s var(--ease);
}
.sidebar-task:hover { background: var(--hover); }
.sidebar-task.selected { background: var(--card-2); border-color: var(--line-2); }
.task-light { width: 7px; height: 7px; margin-top: 6px; flex-shrink: 0; border-radius: 50%; background: var(--ghost); }
.task-light.executing { background: var(--accent); animation: lightPulse 1.6s ease-in-out infinite; }
.task-light.approval { background: transparent; box-shadow: inset 0 0 0 1.5px var(--accent); }
.task-light.approved { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }
.task-light.missing, .task-light.needs-improvement { background: var(--warn); }
.task-light.ready-review { background: var(--accent); }
.task-light.reviewed { background: var(--muted); }
@keyframes lightPulse { 50% { opacity: .35; } }
.task-copy { flex: 1; min-width: 0; }
.task-copy strong, .task-process-label { display: block; font-size: 13px; font-weight: 520; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-task.selected .task-process-label { color: var(--text); }
.task-client-label { display: block; margin: 1px 0 3px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-copy small { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .02em; color: var(--faint); }
.task-unread { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; flex-shrink: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-family: var(--mono); font-size: 10.5px; font-weight: 600; }
.sidebar-task .task-unread { margin-top: 1px; }
.task-share { position: absolute; right: 6px; bottom: 6px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-sm); color: var(--faint); background: var(--card-2); opacity: 0; transition: opacity .2s var(--ease); }
.task-share .i { width: 15px; height: 15px; }
.sidebar-task-row:hover .task-share, .task-share:focus-visible, .sidebar-task-row:focus-within .task-share { opacity: 1; }
.task-share:hover { background: var(--hover); color: var(--text); }
@media (hover: none) { .task-share { opacity: 1; } }

/* ---------- Review Files ---------- */
.review-files-dialog { width: min(640px, calc(100% - 28px)); }
.review-files-dialog h2 { margin-top: 4px; }
#review-files-intro { margin-bottom: 6px; }
.review-file-section { margin-top: 18px; }
.review-file-section h3 { margin: 0 0 6px; font-family: var(--mono); font-size: 11px; font-weight: 450; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.review-file-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.review-file { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.review-file .file-glyph { width: 34px; height: 34px; }
.review-file-details { min-width: 0; }
.review-file-details strong { display: block; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.review-file-details small { display: block; margin-top: 2px; font-family: var(--mono); font-size: 11px; color: var(--faint); }
.review-file-actions { display: flex; gap: 6px; flex-shrink: 0; }
.review-file-unavailable { font-size: 12px; color: var(--faint); }
.review-file-empty { margin: 6px 0 0 !important; font-size: 13px !important; color: var(--faint) !important; }
.review-files-dialog label { display: block; margin: 22px 0 8px; font-size: 13px; font-weight: 520; color: var(--text-2); }
.review-files-dialog textarea { min-height: 104px; }
.review-files-dialog textarea:read-only { opacity: .7; }
.review-files-status { min-height: 20px; margin: 10px 0 0 !important; font-size: 13px !important; color: var(--text-2) !important; }
.review-files-status[data-tone="error"] { color: var(--danger) !important; }
.review-actions { position: sticky; bottom: -28px; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; margin: 12px -28px -28px; padding: 14px 28px 22px; background: var(--card); border-top: 1px solid var(--line); }

/* ---------- Share ---------- */
.quick-share { width: min(460px, calc(100% - 28px)); }
.share-task-preview { display: grid; gap: 3px; margin: 16px 0; padding: 13px 14px; border-radius: var(--r-md); background: var(--card-2); border: 1px solid var(--line-2); font-size: 14px; }
.share-task-preview strong { font-weight: 540; }
.share-task-preview small { font-size: 12.5px; color: var(--faint); }
.share-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 16px 0; }
.share-option { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--card-2); color: var(--text-2); font-size: 13px; transition: transform .3s var(--ease); }
.share-option .i { width: 20px; height: 20px; color: var(--muted); }
.share-option:hover { border-color: var(--line-3); color: var(--text); }
.share-option[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.share-option[aria-pressed="true"] .i { color: var(--accent); }
.quick-share label { display: block; margin: 4px 0 8px; font-size: 13px; font-weight: 520; color: var(--text-2); }
.share-email-field { margin-bottom: 12px; }
.quick-share .share-explanation { font-size: 13px; line-height: 1.6; color: var(--faint); margin-bottom: 14px; }
.copy-summary { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; color: var(--muted); font-size: 13px; }
.copy-summary .i { width: 15px; height: 15px; }
.copy-summary:hover { color: var(--text); }
.share-status { margin-top: 10px; font-size: 13px; line-height: 1.55; color: var(--text-2); }
.share-status:empty { display: none; }
.share-copy-text { margin-top: 10px; min-height: 140px; font-size: 12.5px !important; }

/* Sam reacts to each new step: a single, small movement. */
.sam-motion-0 { animation: samFloat 1.6s var(--ease) both; }
.sam-motion-1 { animation: samNod 1.6s var(--ease) both; }
.sam-motion-2 { animation: samLift 1.6s var(--ease) both; }
.sam-motion-3 { animation: samTilt 1.8s var(--ease) both; }
@keyframes samFloat { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-4px); } }
@keyframes samNod { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(2px) scale(.985); } 60% { transform: translateY(-1px); } }
@keyframes samLift { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.03); } }
@keyframes samTilt { 0%, 100% { transform: rotate(0); } 35% { transform: rotate(-2deg); } 70% { transform: rotate(1.2deg); } }

@media (max-width: 767px) {
  .work-greeting { padding: 12px 0 4px; }
  .work-greeting h1 { font-size: 27px; }
  .sam-message { gap: 10px; margin: 22px 0; }
  .sam-message > .sam-face { width: 28px; height: 28px; }
  .sam-message-body { font-size: 14.5px; }
  .sam-user-message { max-width: 92%; }
  .compact-plan { padding: 16px; margin-left: -38px; }
  .work-status-card { margin-left: -38px; }
  .entity-chip { font-size: 12.5px; }
  .chip-type { display: none; }
  .draft-storage { font-size: 10.5px; }
  .attachment-chip .file-name { max-width: 140px; }
  .review-file { grid-template-columns: 30px minmax(0, 1fr); }
  .review-file-actions { grid-column: 2; }
  .review-actions { flex-direction: column; bottom: -22px; margin: 12px -18px -22px; padding: 12px 18px 16px; }
  .review-actions button { width: 100%; }
  .autocomplete { max-height: 50dvh; }
}

/* Messages with the accountant on a sent task (task-thread.js) */
.task-thread { max-width: 760px; margin: 8px auto 0; padding: 16px 18px 14px; border-radius: var(--r-xl); border: 1px solid var(--line-2); background: var(--card); box-shadow: var(--inset); animation: msgIn .55s var(--ease) both; }
.task-thread-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.task-thread-head h2 { font-size: 15px; font-weight: 560; letter-spacing: -.01em; color: var(--text); }
.task-thread-intro { margin: 4px 0 12px; font-size: 13px; line-height: 1.55; color: var(--muted); }
.task-thread-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.task-thread-empty { font-size: 13px; color: var(--faint); }
.task-msg { max-width: 88%; padding: 9px 12px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--card-2); }
.task-msg.from-client { justify-self: end; border-color: var(--accent-line); background: var(--accent-soft); }
.task-msg.is-held { border-style: dashed; border-color: var(--warn-line); }
.task-msg-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 3px; }
.task-msg-head strong { font-size: 12.5px; font-weight: 540; color: var(--text); }
.task-msg-head small { font-family: var(--mono); font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.task-msg-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.task-msg-held { display: flex; gap: 8px; align-items: flex-start; margin-top: 6px; font-size: 12.5px; line-height: 1.5; color: var(--warn); }
.task-msg-held .i { width: 14px; height: 14px; margin-top: 3px; flex-shrink: 0; }
.task-thread-form { display: flex; gap: 8px; align-items: flex-end; }
.task-thread-form textarea { flex: 1; min-height: 44px; font-size: 14px; }
.task-thread-form .primary { flex-shrink: 0; }
.task-thread-error { margin-top: 8px; font-size: 13px; line-height: 1.5; color: var(--warn); }
@media (max-width: 767px) {
  .task-thread { padding: 14px; }
  .task-msg { max-width: 100%; }
}
