/* Extracted from ecosystem.css — finance analytics leftovers. */
/* --- from ecosystem.css L2887-3231 --- */
/* Finance analytics and operation reports are semantic cards at every width. */
.finance-analysis,
.finance-operation-list {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.finance-analysis {
  display: grid;
  gap: 10px;
}

.finance-analysis-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-accent-soft);
}

.finance-analysis-head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.finance-analysis-head select {
  width: min(180px, 42vw);
  max-width: 100%;
}

.finance-kpi-grid,
.finance-analysis-grid,
.finance-operation-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 10px;
  align-items: start;
}

.finance-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
}

.finance-metric {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  min-height: 62px;
  padding: 11px 12px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm);
  background: var(--tg-theme-bg-color, #fff);
  box-sizing: border-box;
}

.finance-metric.is-primary {
  border-color: color-mix(in srgb, var(--tg-theme-button-color, #3390ec) 32%, var(--ui-border));
  background: var(--ui-accent-soft);
}

button.finance-metric {
  width: 100%;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

button.finance-metric:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--tg-theme-button-color, #3390ec) 55%, transparent);
  outline-offset: 1px;
}

/* Ledger Summary: denser KPI strip than full Analytics, same language */
.fin-cap-summary .finance-kpi-grid {
  gap: 8px;
}
.fin-cap-summary .finance-metric {
  min-height: 48px;
  padding: 8px 10px;
}
.fin-cap-summary .finance-metric-value {
  font-size: 14px;
}
.fin-cap-summary .finance-analysis-section {
  padding: 10px;
}

.finance-metric-label,
.finance-data-cell > span,
.finance-operation-detail > span {
  min-width: 0;
  color: var(--tg-theme-hint-color, #68717d);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.finance-metric-value {
  min-width: 0;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  overflow-wrap: anywhere;
}

.finance-analysis-section {
  min-width: 0;
  margin: 0;
  padding: 11px;
}

.finance-analysis-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.3;
}

.finance-data-list {
  display: grid;
  gap: 8px;
}

.finance-data-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 125px), 1fr));
  gap: 7px 10px;
  min-width: 0;
  padding: 9px 0 0;
  border-top: 1px solid var(--ui-border);
}

.finance-data-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.finance-data-cell {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.finance-data-cell > b {
  min-width: 0;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.finance-trend {
  display: grid;
  gap: 8px;
}

.finance-trend > div {
  display: grid;
  grid-template-columns: minmax(76px, auto) minmax(80px, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.finance-trend i {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--ui-surface-muted);
}

.finance-trend em,
.finance-trend-bar {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--tg-theme-button-color, #3390ec);
}

.finance-trend-bar {
  background: transparent;
  overflow: visible;
}

.finance-trend-bar rect {
  fill: var(--tg-theme-button-color, #3390ec);
}

.deal-qr-img {
  display: block;
  max-width: 100%;
  max-height: 220px;
  border-radius: 12px;
}

.finance-operation-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--ui-border);
  border-inline-start: 3px solid color-mix(in srgb, var(--tg-theme-button-color, #3390ec) 55%, transparent);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface-raised, var(--tg-theme-bg-color, #fff));
  box-sizing: border-box;
}

.finance-operation-card header {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ui-border);
}

.finance-operation-card header time {
  color: var(--tg-theme-hint-color, #68717d);
  font-size: 12px;
  text-align: right;
}

.finance-operation-number {
  font-weight: 750;
}

.finance-operation-client {
  min-width: 0;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.finance-operation-amount {
  min-width: 0;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  text-align: right;
  overflow-wrap: anywhere;
}

.finance-operation-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 105px), 1fr));
  gap: 8px 12px;
  min-width: 0;
  padding-top: 2px;
}

.finance-operation-detail {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.finance-operation-detail > b {
  min-width: 0;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.finance-operation-card.is-interactive {
  cursor: pointer;
}

.finance-operation-card.is-interactive:focus-visible {
  outline: 2px solid var(--tg-theme-button-color, #3390ec);
  outline-offset: 2px;
}

.wallet-card-list {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.wallet-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  margin: 0;
}

.wallet-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.wallet-card header > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.wallet-card header span,
.wallet-card-meta {
  color: var(--tg-theme-hint-color, #68717d);
  font-size: 12px;
}

.wallet-card header b {
  min-width: 0;
  overflow-wrap: anywhere;
}

.wallet-card header strong {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.wallet-address {
  min-width: 0;
  padding: 8px;
  border-radius: var(--ui-radius-xs);
  background: var(--ui-surface-muted);
  overflow-wrap: anywhere;
}

.wallet-threshold-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

/* Extracted from ecosystem.css — ban prose + ledger sheet utilities.
 (.ban-watch-row richer rules already live above in this file.) */
.ban-prose { white-space: pre-wrap; }

/* Ledger sheet utilities (ecosystem pass) */
.led-th-note {
  font-weight: 500; font-size: 11px;
  color: var(--ui-muted-strong, color-mix(in srgb, var(--tg-theme-text-color,#111) 90%, #1f2937));
}
.led-td-muted { color: var(--ui-muted-strong, color-mix(in srgb, var(--tg-theme-text-color,#111) 90%, #1f2937)); }
.led-cur-hdr { font-weight: 650; }
.led-cur-chev { display: inline-block; width: 1.1em; color:var(--ui-muted-strong,#4b5563); }
.led-cur-glance {
  font-weight: 500; font-size: 12px; margin-left: 8px;
  color: var(--ui-muted-strong, color-mix(in srgb, var(--tg-theme-text-color,#111) 90%, #1f2937));
}
.led-form-indent { padding-left: 22px; }
.led-hint-sub {
  display: block; font-size: 11px; margin-top: 2px;
  color: var(--ui-muted-strong, color-mix(in srgb, var(--tg-theme-text-color,#111) 90%, #1f2937));
}
.led-fee-hint { font-size: 12px; font-style: italic; opacity: 1; }
.led-derived-formula { color: var(--tg-theme-text-color,#111); opacity:1; }
.led-fee-hint.is-warn { color: var(--neg, #d11); opacity: 1; }
.led-rate-note-ok { color:#0f6f31; opacity:1; }
html[data-theme="dark"] .led-rate-note-ok { color:#8ee6a3; }
.led-forms-meta { font-size: .85em; opacity: .8; }
.led-meta-dim { opacity: .7; }
.led-card-reversed { opacity: .5; }
.led-toolbar-flex { display: flex; gap: 6px; flex-wrap: wrap; }
.led-span-scroll { max-height: 40vh; overflow-y: auto; margin-bottom: 8px; }
.led-sheet-pin { opacity: .85; color: inherit; font-weight: 650; flex-shrink: 0; min-width: 28px; }
.led-sheet-pin.is-pinned {
  opacity: 1;
  color: var(--ui-accent-solid, var(--tg-theme-button-color, #3390ec));
}
.led-sheet-tab { font-size: .92em; }
.led-shortcuts-dim { opacity: .95; }
.led-recon-badge { background: var(--neg); color: #fff; border-radius: 8px; padding: 0 5px; font-size: .8em; }
.led-w3ch { width: 3.8ch; }
.led-w5ch { width: 5ch; }
.led-w6ch { width: 6ch; }
.led-w14ch { width: 14ch; }
.led-w22ch { width: 22ch; }
.led-w24ch { width: 24ch; }
.led-ref-row { margin-top: 6px; }
.led-ref-row-tight { margin-top: 4px; }
.fin-mini-th-left { text-align: left; }
.fin-mini-th-right { text-align: right; }
.fin-prose-muted { white-space: normal; }
.fin-prose-muted.is-reversed { opacity: .55; }
.fin-flow-amt { font-weight: 600; }
.led-w9ch { width: 9ch; }
.led-w18ch { width: 18ch; }
.led-movement { white-space: normal; }
.fin-empty-cell { text-align: center; }

