/* v11 — feuille d'ajout à un champ */

/* Phone: the two columns flatten into one flow, ordered by the `order` values below
   (segment · amount · keypad · pour quoi · catégorie · suivis · date · plus · blocs). */
@media (max-width: 899px) {
  .addform > .add-col { display: contents; }
  .addform .ad-date { order: 7; }
  .addform .add-more { order: 8; }
  .addform .add-blocks { order: 9; }
  .addform .add-blocks:empty { display: none; }
  .addform > .form-error { order: 20; }
  .addform > .sheet-actions { order: 21; }
  .addform { gap: 12px; }
  .addform .keypad { gap: 6px; }
  .addform .keypad button { min-height: 42px; font-size: 19px; }
  .addform .keypad .keypad-ok { min-height: 38px; }
  .addform .add-top .seg button { min-height: 36px; }
  .addform .amount-wrap { padding: 2px 0 0; }
  .addform .field { gap: 5px; }
}
.add-blocks { display: flex; flex-direction: column; gap: 14px; }
.add-blocks:empty { display: none; }

/* « Pour quoi ? » : one field, the merchant logo on the left once it is recognised */
.pq-wrap { position: relative; display: flex; align-items: center; }
.pq-wrap .input { flex: 1; min-width: 0; transition: padding-left .15s var(--ease, ease); }
.pq-wrap.has-logo .input { padding-left: 44px; }
.pq-wrap > .mlogo { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); z-index: 1; border-radius: 7px; pointer-events: none; animation: pop .25s var(--spring, ease); }
.pq-chips { align-items: center; max-height: 88px; }
.pq-chips .favs-label { display: inline-block; width: auto; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-right: 2px; }
.pq-chips .chip.fav { border-color: var(--accent-line, var(--border)); }
.pq .what-known { margin: 0; }

/* « Plus » row: four icon buttons */
.add-more { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.add-more-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 54px; padding: 6px 4px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 600; line-height: 1.1; transition: background .2s, color .2s, border-color .2s, transform .15s var(--ease, ease); }
.add-more-btn svg { width: 20px; height: 20px; }
.add-more-btn.on { background: var(--accent-soft); color: var(--accent-text, var(--accent)); border-color: var(--accent-line, var(--accent)); }
.add-more-btn:active { transform: scale(.96); }
.add-more:has(.add-more-btn:only-child) { grid-template-columns: minmax(0, 1fr); }

/* Blocks */
.ticket-box .ticket-btn { align-self: flex-start; gap: 8px; }
.ticket-box .ticket-btn .muted { font-weight: 500; }
.ticket-box .scan { margin-bottom: 4px; }
.share-box .seg { overflow-x: auto; scrollbar-width: none; }
.share-box .seg::-webkit-scrollbar { display: none; }
.share-box .seg button { white-space: nowrap; flex: 1 0 auto; }
.repeat-field .field-label .link, .share-box .field-label .link, .split .field-label .link { margin-left: auto; }
.repeat-field .field-label, .share-box .field-label, .split .field-label { display: flex; align-items: center; gap: 6px; }

/* Actions: primary + text button */
.sheet-actions .link.add-again { flex: 0 0 auto; padding: 0 8px; }
.sheet-actions .btn.primary { flex: 1; }

/* Desktop: amount, keypad and date on the left, everything else on the right (existing .add-col grid) */
@media (min-width: 900px) {
  .add-main .ad-date { margin-top: 4px; }
  .add-more { max-width: 460px; }
}

/* Lists: state badges after the meta line */
.tx-meta { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; row-gap: 2px; }
.tx-meta-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 0 auto; max-width: 100%; }
.tx-badges { display: inline-flex; gap: 4px; flex: none; }
.tx-badge { display: inline-block; font-size: 10px; font-weight: 600; letter-spacing: .03em; padding: 1px 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2); line-height: 1.5; white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.tx-badge.more { background: transparent; }
.tx-badge.warn { color: var(--warn-ink, #d9a441); border-color: color-mix(in srgb, var(--warn-ink, #d9a441) 45%, transparent); }
.time-input { min-height: 44px; -webkit-appearance: none; appearance: none; font-size: 16px; }
.time-input::-webkit-date-and-time-value { text-align: left; min-height: 1.4em; }
