/* 新建 · 详情 (view agent 2: views/new.js, views/request.js). Composes design A components
   (components.css); only layout glue and a few small parts live here, all on tokens (dark mode follows). */

/* =========================================================================
   新建 #/new
   ========================================================================= */
.new-banners { margin-top: var(--space-6); }

/* limit warnings under the amount (warn, never block) */
.new-warn { display: flex; flex-direction: column; gap: var(--space-1); margin-top: var(--space-1); list-style: none; font-size: var(--text-sm); line-height: 1.55; color: var(--warning-text); }
.new-warn li { display: flex; align-items: flex-start; gap: 6px; }
.new-warn .icon { margin-top: 2px; }

.counter[data-state="over"] { color: var(--danger-text); }

/* live preview of the automatic approval text under the custom one */
.new-auto { margin-top: var(--space-1); }
.new-auto__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-1) var(--space-3); margin-bottom: var(--space-1); }
.new-auto__head .quote__label { margin-bottom: 0; }
.new-auto__use { font-size: var(--text-xs); }
.new-auto__text { display: block; overflow-wrap: anywhere; }
.new-auto--inactive { border-left-color: var(--border-strong); }
.new-auto--inactive .new-auto__text { color: var(--text-3); }

.new-preview .vcard { margin: 0 auto; }
.new-ledger__item { min-width: 0; max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.new-alert:empty { display: none; }
.new-alert__detail { color: var(--text-2); overflow-wrap: anywhere; }
.new-aside .banner__actions { align-self: flex-start; }

/* =========================================================================
   详情 #/r/<id>
   ========================================================================= */
.req-banners { margin-top: var(--space-6); }
.req-banners:not([hidden]) + .req-hero { margin-top: var(--space-5); }

/* heroes without an aside (or whose aside is hidden on phones) use one column */
.hero.req-hero--single { grid-template-columns: minmax(0, 1fr); }

/* a phone cannot scan its own screen: no QR there, just the big button */
@media (max-width: 599px) {
  .req-hero__qr { display: none; }
}
.req-label--narrow { display: none; }
@media (max-width: 599px) {
  .req-label--wide { display: none; }
  .req-label--narrow { display: inline; }
  /* phones: the hero's main actions stack at full width; a wrapped foot action sits at the end */
  .req-hero .hero__main > .action-bar > .btn { flex: 1 1 100%; }
  .req-hero .hero__foot > .btn { margin-left: auto; }
}

/* 3DS aside without a QR */
.req-mark { display: grid; place-items: center; width: 104px; height: 104px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--status-requires_action-fg); }

/* approved: reveal button / auto-hide bar under the card */
.req-reveal { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); width: 100%; max-width: 420px; }
.req-reveal__btn { width: 100%; }
.req-reveal__hint { display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.req-hero .autohide { width: 100%; max-width: 420px; }
.req-reassure { display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--text-xs); line-height: 1.65; color: var(--text-3); }
.req-reassure .icon { margin-top: 1px; color: var(--accent-text); }
.req-line { display: block; }
.req-used { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--success-text); }

/* final / problem states: a status pill above the title, in the status colours */
.req-final__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  height: 28px;
  padding: 0 12px 0 10px;
  border-radius: var(--radius-pill);
  background: var(--st-bg);
  color: var(--st-fg);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}
.req-final__status[data-status="cancelled"] { box-shadow: inset 0 0 0 1px var(--border-strong); }
.req-ledger { max-width: 460px; }
.req-ledger .ledger__value { min-width: 0; white-space: normal; text-align: right; overflow-wrap: anywhere; } /* long decline codes wrap on phones */
/* phones: a finished request leads with what happened; the spent card follows, smaller */
@media (max-width: 899px) {
  .req-hero--final .hero__main { order: -1; }
  .req-hero--final .hero__aside { padding: var(--space-6) var(--space-5); border-top: 1px solid var(--border); border-bottom: 0; }
  .req-hero--final .hero__aside .vcard { max-width: 280px; }
}

/* report modal: tag chips without a monogram */
.chip.req-tagchip { padding: 0 var(--space-3); }
.req-modal-warn { display: flex; align-items: flex-start; gap: 6px; font-size: var(--text-sm); line-height: 1.55; color: var(--warning-text); }
.req-modal-warn .icon { margin-top: 2px; }

.req-timeline-more { margin-top: var(--space-5); }
.req-note { white-space: pre-wrap; overflow-wrap: anywhere; }
