.aflp {
  width: 100%;
  min-width: 0;
  margin-top: 1.15rem;
  color: var(--text);
}

.aflp__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
}

.aflp__title {
  margin: 0;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 800;
  letter-spacing: -0.012em;
}

.aflp__intro {
  max-width: 68ch;
  margin: 0.24rem 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.5;
}

.aflp__count,
.aflp__tag {
  flex: none;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.aflp__count {
  padding: 0.24rem 0.48rem;
  color: var(--ink);
  background: var(--green-soft);
}

.aflp__announcement {
  margin: 0.7rem 0 0;
  padding: 0.58rem 0.68rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  background: var(--card);
  font-size: 0.72rem;
  line-height: 1.45;
}

.aflp__announcement:empty {
  display: none;
}

.aflp__announcement[data-state="success"] {
  border-color: color-mix(in srgb, var(--green) 55%, var(--border));
  color: var(--ink);
  background: var(--green-soft);
}

.aflp__announcement[data-state="warning"] {
  border-color: color-mix(in srgb, var(--goldHi) 45%, var(--border));
  color: var(--ink);
  background: var(--gold-soft);
}

.aflp__announcement[data-state="error"] {
  color: var(--red);
}

.aflp__list {
  display: flex;
  flex-direction: column;
  gap: 0.78rem;
  margin-top: 0.8rem;
}

.aflp__item {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--inset);
}

.aflp__item[aria-busy="true"] {
  cursor: wait;
}

.aflp__item:focus-visible {
  outline: 2px solid var(--goldHi);
  outline-offset: 3px;
}

.aflp__evidence {
  padding: 0.9rem 1rem 0.95rem;
}

.aflp__identity {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
}

.aflp__borrower {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.aflp__balance {
  margin-top: 0.18rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.63rem;
  line-height: 1.45;
}

.aflp__tag {
  padding: 0.23rem 0.44rem;
  color: var(--ink);
  background: var(--gold-soft);
  white-space: nowrap;
}

.aflp__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem 0.65rem;
  margin-top: 0.65rem;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.59rem;
  line-height: 1.5;
}

.aflp__facts a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.aflp__facts a:hover {
  color: var(--blueHi);
}

.aflp__quote {
  margin: 0.72rem 0 0;
  padding: 0.68rem 0.78rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.aflp__currency {
  margin: 0.58rem 0 0;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.45;
}

.aflp__currency[data-state="mismatch"],
.aflp__block {
  color: var(--red);
}

.aflp__confirm {
  padding: 0.92rem 1rem 1rem;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 52%, transparent);
}

.aflp__confirm-title {
  margin: 0 0 0.68rem;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 800;
}

.aflp__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.68rem;
}

.aflp__field {
  min-width: 0;
}

.aflp__field--wide {
  grid-column: 1 / -1;
}

.aflp__field label {
  display: block;
  margin-bottom: 0.32rem;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
}

.aflp__field input,
.aflp__field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: 0;
  background: var(--input-bg);
  color: var(--ink);
  font: 600 0.8rem var(--font);
}

.aflp__field input {
  min-height: 42px;
  padding: 0.56rem 0.68rem;
}

.aflp__field textarea {
  min-height: 64px;
  resize: vertical;
  padding: 0.62rem 0.68rem;
  line-height: 1.45;
}

.aflp__field input:focus,
.aflp__field textarea:focus {
  border-color: var(--goldHi);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.aflp__field input:disabled,
.aflp__field textarea:disabled {
  cursor: not-allowed;
  opacity: 0.66;
}

.aflp__help {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.4;
}

.aflp__block {
  margin: 0.65rem 0 0;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.45;
}

.aflp__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.aflp__status {
  min-width: 0;
  margin: 0 auto 0 0;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.4;
}

.aflp__status[data-state="error"] {
  color: var(--red);
}

.aflp__button {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.56rem 0.82rem;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font: 750 0.76rem var(--font);
}

.aflp__button:hover:not(:disabled) {
  border-color: var(--border-strong);
  color: var(--ink);
}

.aflp__button--accept {
  border-color: transparent;
  background: var(--goldHi);
  color: #11151b;
}

.aflp__button--accept:hover:not(:disabled) {
  border-color: transparent;
  color: #11151b;
  filter: brightness(1.05);
}

.aflp__button--reject:hover:not(:disabled),
.aflp__button--reject[data-armed="true"] {
  border-color: var(--red);
  color: var(--red);
}

.aflp__button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.aflp__empty,
.aflp__load-error {
  margin-top: 0.8rem;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.55;
}

.aflp__load-error .aflp__button {
  margin-top: 0.65rem;
}

@media (max-width: 680px) {
  .aflp__head,
  .aflp__identity,
  .aflp__actions {
    align-items: stretch;
  }

  .aflp__head,
  .aflp__identity {
    flex-direction: column;
  }

  .aflp__count,
  .aflp__tag {
    align-self: flex-start;
  }

  .aflp__fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .aflp__field--wide {
    grid-column: auto;
  }

  .aflp__actions {
    flex-wrap: wrap;
  }

  .aflp__status {
    flex: 1 0 100%;
    order: 3;
  }

  .aflp__button {
    flex: 1 1 130px;
  }
}
