/* New-note composer: pinned to the bottom on phones (thumb reach), on top on wide screens. */

.composer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem calc(0.6rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
}

#note-input {
  flex: 1;
  min-height: 2.75rem;
  max-height: 40dvh;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 1.375rem;
  font: inherit;
  font-size: 16px;                   /* below 16px iOS zooms the page on focus */
  line-height: 1.4;
  resize: none;
  overflow-y: auto;
  background: var(--card);
  color: inherit;
}
#note-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

.send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border-radius: 999px;
}
.send .label { display: none; }

.composer-row { display: flex; align-items: flex-end; gap: 0.35rem; }
.attach { flex: none; color: var(--muted); }
.attach:hover { background: var(--hover); color: var(--fg); }

@media (min-width: 48rem) {
  .composer {
    position: static;
    order: -1;                       /* composer above the notes */
    margin-bottom: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    backdrop-filter: none;
  }
  #note-input { border-radius: 8px; }
  .attach { border-radius: 8px; }
  .send { width: auto; padding: 0 1.1rem; border-radius: 8px; }
  .send .label { display: inline; }
}
