/* Record type pills, computed fee field, info badges and the account detail
   meta (label / note). */

.side-transfer { color: var(--blue); background: var(--blue-bg); border-color: var(--blue-line); }
/* Computed-only transfer fee: visibly non-editable. */
#t-networkfee[readonly] { opacity: 0.55; cursor: not-allowed; background: var(--surface-2); }
/* Tap-for-info affordance: ⓘ badge on labels whose value opens a popup. */
.info-dot { opacity: 0.55; font-size: 0.82em; margin-left: 0.3rem; }
/* Transfer-fees card value opens the plain-language explainer. */
.trade-block .stat-row[data-label="Transfer fees"] .stat-val { cursor: pointer; }
.side-income { color: var(--violet); background: var(--violet-bg); border-color: var(--violet-line); }
.side-expense { color: var(--amber); background: var(--amber-bg); border-color: var(--amber-line); }

.fld-hint {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}

.trade-edit { margin-left: auto; padding: 0.45rem 0.7rem; min-height: 2.5rem; font-size: 1rem; line-height: 1; }
.trade-edit:hover { color: var(--accent); border-color: var(--accent-line); }

/* ————— Account detail meta (label / note, inside the header box) ————— */
.detail-meta-block {
  flex: 1 1 100%;
  display: grid;
  gap: 0.2rem;
  margin-top: 0.25rem;
  min-width: 0;
}
.detail-meta {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.85rem;
  min-width: 0;
}
.detail-meta-label {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.detail-meta-val {
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Multi-line account labels: wrap fully, break long tokens. */
.detail-meta-val.detail-meta-multiline {
  white-space: pre-wrap;
  overflow: visible;
  overflow-wrap: anywhere;
}
/* Label rows stack: caption above, text underneath. */
.detail-meta-stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 0.15rem;
}
/* Descriptions are prose of any length: body font, clamped to five lines
   so the header box keeps its size; "Show more" opens the full text. */
.detail-meta-val.detail-meta-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  overflow: hidden;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text);
}
/* 15px (0.9375rem) between the label text and this caption: the block's
   0.2rem row gap plus this margin. */
.detail-meta-block > * + .detail-meta[data-label="Description"] { margin-top: 0.7375rem; }
.detail-meta-more {
  align-self: flex-start;
  min-height: 0;
  padding: 0.1rem 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.detail-meta-more:hover { color: var(--text); }
.detail-meta-more[hidden] { display: none; }
.meta-editor { display: grid; min-width: 0; }
.meta-editor textarea[data-description-input] { min-height: 8rem; max-height: 60vh; resize: vertical; }
.label-edit-row {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.label-edit-row button { min-width: 6rem; }
.label-edit-row .char-counter { margin-left: auto; align-self: center; }

/* ————— Character counter (capped text fields) —————
   Fixed 2rem box so typing never shifts the layout; the ring starts small,
   enlarges near the cap to fit the "characters left" number, amber at the
   warning zone, red at the cap. */
.char-counter {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
}
.char-counter-ring {
  width: 1.25rem;
  height: 1.25rem;
  overflow: visible;
  transition: transform 0.15s var(--ease);
}
.char-counter[data-state="warn"] .char-counter-ring,
.char-counter[data-state="full"] .char-counter-ring { transform: scale(1.6); }
.char-counter-track { fill: none; stroke: var(--border-strong); stroke-width: 2; }
.char-counter-bar {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.12s linear, stroke 0.15s;
}
.char-counter[data-state="warn"] .char-counter-bar { stroke: var(--amber); }
.char-counter[data-state="full"] .char-counter-bar { stroke: var(--red); }
.char-counter-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  pointer-events: none;
}
.char-counter[data-state="full"] .char-counter-num { color: var(--red); }
.char-counter-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
/* Single-line field with the counter tucked inside its right edge. */
.char-counted { position: relative; }
.char-counted > input { padding-right: 2.6rem; }
.char-counted > .char-counter {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
}
