/* ------------------------------------------------------------
   view-tool-composer.css — zone de saisie commune, outil (lot 07)
   Référence : handoffs/07-ecran-outil-revision/README.md
   ------------------------------------------------------------ */

.composer {
  flex: none;
  margin: var(--sp-2) 0 calc(env(safe-area-inset-bottom, 0px) + var(--sp-3));
  background: var(--surface);
  border-radius: 28px;
  box-shadow: 0 8px 28px rgba(14, 20, 25, .10), 0 0 0 1px var(--line);
  padding: 16px 12px 12px 18px;
  display: grid;
  gap: var(--sp-2);
}
:root[data-theme="dark"] .composer { box-shadow: 0 8px 28px rgba(0, 0, 0, .45), 0 0 0 1px var(--line); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .composer { box-shadow: 0 8px 28px rgba(0, 0, 0, .45), 0 0 0 1px var(--line); }
}

.composer__field {
  width: 100%;
  border: 0;
  background: transparent;
  resize: none;
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  max-height: 160px;
  overflow-y: auto;
}
.composer__field::placeholder { color: var(--muted); }
.composer__field:focus { outline: none; }

.composer__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.composer__pills {
  order: 1;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}
.composer__pills::-webkit-scrollbar { display: none; }

.pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 10px 0 8px;
  border-radius: var(--r-pill);
  border: 1px solid var(--field);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.pill .icon { width: 16px; height: 16px; flex: none; }
.pill .icon:last-child { width: 14px; height: 14px; color: var(--muted); }
.pill--primary { background: var(--tint); border-color: transparent; }
.pill--plain { padding: 0 10px; }

.composer__submit {
  flex: none;
  order: 3;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-family: var(--font-text);
}
.composer__submit:active { background: var(--accent-pressed); }
.composer__submit[disabled] { background: var(--disabled-bg); color: var(--disabled-fg); cursor: not-allowed; }
.composer__submit .btn-spinner { width: 18px; height: 18px; border-width: 2px; }
.composer__submit-icon--desktop, .composer__submit-label { display: none; }

/* Mention de coût : sous la saisie sur mobile (ligne à part), entre les
   pastilles et le bouton sur grand écran (lot 07, structure desktop). */
.composer__cost {
  order: 4;
  flex-basis: 100%;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

@media (min-width: 960px) {
  .composer {
    border-radius: 24px;
    box-shadow: 0 12px 40px rgba(14, 20, 25, .14), 0 0 0 1px var(--line);
  }
  :root[data-theme="dark"] .composer { box-shadow: 0 12px 40px rgba(0, 0, 0, .55), 0 0 0 1px var(--line); }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .composer { box-shadow: 0 12px 40px rgba(0, 0, 0, .55), 0 0 0 1px var(--line); }
  }

  .composer__row { flex-wrap: nowrap; }
  .composer__cost { order: 2; flex-basis: auto; text-align: right; white-space: nowrap; }
  .composer__submit {
    order: 3;
    width: auto;
    height: 48px;
    border-radius: var(--r-pill);
    padding: 0 20px 0 16px;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
  }
  .composer__submit-icon--mobile { display: none; }
  .composer__submit-icon--desktop, .composer__submit-label { display: inline-flex; }
}
