/* Wikiclash — Amis et échanges. */
.am-main { display: grid; grid-template-columns: minmax(220px, .9fr) minmax(0, 1.2fr) minmax(260px, 1fr); gap: clamp(20px, 3vw, 48px); padding: clamp(14px, 2.8vh, 28px) var(--pad-x) clamp(10px, 2vh, 18px); min-height: 0; }
.am-col { display: flex; flex-direction: column; gap: clamp(8px, 1.6vh, 14px); min-height: 0; min-width: 0; }
.am-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--ln); padding-bottom: 6px; }
.am-h .t { font-family: var(--serif); font-size: clamp(24px, 4.2vh, 34px); line-height: 1.05; }
.am-h .mut, .am-col .mut { color: var(--mut); font-size: 13px; }
.am-col > .wc-input { width: 100%; padding: 6px 10px; }

/* liste des amis */
.am-list { flex: 1; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid var(--bg3); }
.am-fr { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: clamp(5px, 1vh, 8px) 6px; border: 0; border-bottom: 1px solid var(--bg3); background: none; text-align: left; flex: none; cursor: pointer; color: inherit; font: inherit; transition: background 140ms ease; }
.am-fr[data-pending] { cursor: default; }
.am-fr:hover { background: var(--bg2); }
.am-fr.on { background: var(--sel); box-shadow: inset 3px 0 0 var(--link); }
.am-fr:focus-visible { outline: 2px solid var(--link); outline-offset: -2px; }
.am-fr.off { opacity: .75; }
.am-main .av { display: flex; align-items: center; justify-content: center; overflow: hidden; border: 1px solid var(--ln); background: repeating-linear-gradient(135deg, var(--bg) 0 7px, var(--bg3) 7px 8px); font-family: var(--serif); color: var(--mut); flex: none; }
.am-fr .av { width: 34px; height: 34px; font-size: 17px; }
.am-main .av img { width: 100%; height: 100%; object-fit: cover; }
.am-fr .tx, .am-who .tx { display: flex; flex-direction: column; min-width: 0; }
.am-fr .nm { font-family: var(--serif); font-size: 17px; line-height: 1.15; color: var(--link); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-fr .sb, .am-who .sb { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-fr .sb i, .am-who .sb i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.am-fr .bt { display: flex; gap: 8px; align-items: center; }
.am-fr .btn { font-size: 12px; padding: 4px 10px; white-space: nowrap; }
.am-fr .tag { font-size: 12px; color: var(--mut); border: 1px solid var(--ln2); padding: 2px 8px; }
.am-badge { min-width: 20px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; background: var(--link); color: var(--on); font-size: 11px; font-weight: 700; }
.am-none { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 4px; font-size: 13px; color: var(--sub); }

/* ami choisi */
.am-mid { overflow: hidden; }
.am-who { display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--ln); padding-bottom: 10px; }
.am-who .av { width: 56px; height: 56px; font-size: 28px; }
.am-who .nm { font-family: var(--serif); font-size: clamp(26px, 4.4vh, 36px); line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-act { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.am-act .lnk { margin-left: auto; }
.lnk.err { color: var(--err); }
.am-fee { font-size: 12px; line-height: 1.5; color: var(--sub); background: var(--bg2); border-left: 3px solid var(--warn); padding: 8px 12px; }
.am-hl { display: flex; justify-content: space-between; padding-bottom: 0; }
.am-tl, .am-inbox { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.am-empty { margin: auto 0; display: flex; flex-direction: column; gap: 10px; max-width: 460px; }
.am-empty .h { font-family: var(--serif); font-size: clamp(24px, 4vh, 32px); }
.am-empty p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--sub); }

/* un échange : ce que je donne ⇄ ce que je reçois */
.am-tr { flex: none; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--ln2); border-left: 3px solid var(--ln); background: var(--bg); padding: 10px 12px; }
.am-tr.st-pending { border-left-color: var(--link); }
.am-tr.st-accepted { border-left-color: var(--ok); }
.am-tr.st-refused, .am-tr.st-cancelled, .am-tr.st-expired { opacity: .7; }
.am-tr .hd { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink); }
.am-tr .hd .s { font-size: 12px; color: var(--mut); white-space: nowrap; }
.am-tr.st-accepted .hd .s { color: var(--ok); }
.am-tr .bd { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: start; }
.am-tr .ar { align-self: center; color: var(--mut); font-size: 16px; }
.am-tr .side { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.am-tr .wh { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--mut); }
.am-tr .it { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 6px; align-items: center; font-size: 12px; color: var(--ink); }
.am-tr .it .im, .am-cp .pr .im { width: 22px; height: 22px; border: 1px solid var(--ln2); border-bottom: 3px solid var(--rc, var(--ln)); background: var(--bg3) 50% 20% / cover no-repeat; }
.am-tr .it.pz .im { border-bottom-color: var(--warn); display: flex; align-items: center; justify-content: center; background: none; }
.am-tr .it.pz .im svg { width: 16px; height: 16px; }
.am-tr .it .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-tr .it b { font-size: 11px; color: var(--sub); }
.am-tr .it.none { display: block; color: var(--mut); font-style: italic; }
.am-tr .ac { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.am-tr .ac .btn { font-size: 12px; padding: 4px 10px; }

/* composer un échange */
.am-ovl .wc-box { max-width: min(1040px, 100%); width: 100%; height: min(760px, calc(100% - 16px)); }
.am-cp { display: flex; flex-direction: column; gap: 12px; min-height: 0; flex: 1; }
.am-cp .hd { display: flex; flex-direction: column; gap: 6px; }
.am-cp .cols { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.am-cp .col { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
.am-cp .ch { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; border-bottom: 2px solid var(--bg3); padding-bottom: 4px; }
.am-cp .ch .t { font-family: var(--serif); font-size: 20px; }
.am-cp .col > .wc-input { width: 100%; padding: 5px 9px; font-size: 13px; }
.am-cp .pool { flex: 1; min-height: 80px; display: flex; flex-direction: column; border: 1px solid var(--bg3); }
.am-cp .pr { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 18px; gap: 8px; align-items: center; padding: 4px 8px; border: 0; border-bottom: 1px solid var(--bg3); background: none; text-align: left; cursor: pointer; color: var(--ink); font: inherit; font-size: 13px; flex: none; }
.am-cp .pr:hover:not(:disabled) { background: var(--sel3); }
.am-cp .pr.in { background: var(--sel); }
.am-cp .pr:disabled { cursor: default; color: var(--mut); }
.am-cp .pr .n { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-cp .pr .n em { font-style: normal; font-size: 11px; color: var(--mut); margin-left: 6px; }
.am-cp .pr .q { font-size: 11px; color: var(--sub); }
.am-cp .pr .pl { color: var(--link); font-weight: 700; text-align: center; }
.am-cp .chosen { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; max-height: 72px; overflow-y: auto; font-size: 12px; }
.am-cp .chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--ln2); background: var(--bg2); padding: 2px 4px 2px 8px; color: var(--ink); }
.am-cp .chip i { width: 8px; height: 8px; background: var(--rc); }
.am-cp .chip button { border: 0; background: none; color: var(--mut); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 3px; }
.am-cp .chip button:hover { color: var(--err); }
.am-cp .pz { display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-size: 13px; color: var(--sub); }
.am-cp .pz input { width: 110px; padding: 4px 8px; text-align: right; }
.am-cp .sum { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--sub); border-top: 1px solid var(--ln); padding-top: 10px; }
.am-cp .sum b { color: var(--ink); }
.am-cp .sum .err, .am-cp .sum .err b { color: var(--err); }
.am-cp .pr.lock .n { color: var(--mut); }
.am-cp .wc-toast:not(.on) { min-height: 0; height: 0; }
@media (max-height: 700px) {
  .am-ovl .wc-box { padding: 14px 20px; gap: 8px; height: calc(100% - 16px); }
  .am-ovl .wc-box h2 { font-size: 24px; padding-bottom: 4px; }
  .am-cp { gap: 8px; }
  .am-cp .hd p { display: none; }
  .am-cp .col { gap: 6px; }
  .am-cp .chosen { max-height: 48px; min-height: 22px; }
  .am-cp .sum { padding-top: 6px; }
}
.am-fr[data-pending] { grid-template-columns: 34px minmax(0, 1fr); } .am-fr[data-pending] .bt { grid-column: 2; }
.am-who a.nm { color: var(--link); text-decoration: none; }
.am-who a.nm:hover { text-decoration: underline; }
.am-avl { display: block; flex: none; }
.am-avl:focus-visible, .am-who a.nm:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
