/* The compose window (compose.js). Docked bottom-right on wide screens,
   full screen on phones. Tokens: tokens.css. */

.composer {
  position: fixed;
  right: 24px;
  bottom: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  width: min(600px, calc(100vw - 48px));
  height: min(640px, calc(100dvh - 72px));
  background: var(--surface);
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  box-shadow: var(--shadow-3);
  animation: rise 160ms ease;
}
.compose-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 4px 8px 4px 18px;
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  background: var(--surface-2);
}
.compose-head h2 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 650; }
.compose-status { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.compose-fields { padding: 0 18px; }
.compose-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border-bottom: 1px solid var(--border);
}
.recipients { position: relative; }
.suggestions {
  position: absolute;
  left: 56px;
  right: 0;
  top: 100%;
  z-index: 2;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-3);
}
.suggestion { display: grid; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.suggestion.on, .suggestion:hover { background: var(--surface-2); }
.suggestion-name { font-weight: 550; }
.compose-label { flex: none; width: 56px; color: var(--muted); font-size: 14px; }
.compose-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}
.compose-input:focus-visible { box-shadow: none; }
select.compose-input { cursor: pointer; }
.compose-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 4px 12px;
  border-bottom: 1px solid var(--border);
}
.compose-link { display: flex; gap: 8px; padding: 6px 18px; border-bottom: 1px solid var(--border); }
.compose-link .compose-input { height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; }
.editor {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  padding: 14px 18px;
  outline: none;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.editor blockquote { margin: 6px 0; padding-left: 12px; border-left: 3px solid var(--border); color: var(--muted); }
.editor a { color: var(--accent-ink); }
.editor ul, .editor ol { padding-left: 24px; }
.compose-files { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 4px 18px 8px; list-style: none; }
.compose-file {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 260px;
  padding: 4px 4px 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
}
.compose-file .attachment-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose-problem { margin: 0 18px 8px; padding: 8px 12px; border-radius: var(--radius-s); background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--text); font-size: 14px; }
.compose-schedule { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 18px; border-top: 1px solid var(--border); }
.compose-schedule .compose-field { flex: 1 1 100%; border: 0; }
.compose-schedule .compose-input { border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; }
.compose-foot { display: flex; align-items: center; gap: 4px; padding: 10px 14px 12px 18px; border-top: 1px solid var(--border); }
.compose-foot .button { min-width: 96px; }

@media (max-width: 719px) {
  .composer { inset: 0; width: auto; height: auto; border-radius: 0; }
  .compose-head { border-radius: 0; }
}
@media (pointer: coarse) {
  .compose-input { font-size: 16px; }
}
