/* Extracted from ecosystem.css — Ledger utility widths, compact tables and Pro density rules. */
/* Load after ecosystem.css and before existing ecosystem feature sheets; original order preserved. */

    /* ledger compact polish */
    .led-w8ch { width:8ch; }
    .led-w9ch { width:9ch; }
    .led-w12ch { width:12ch; }
    .led-w18ch { width:18ch; }
    .led-w100 { width:100%; }
    .led-zero-amt { opacity:.45; }
    .led-flow-amt { font-variant-numeric:tabular-nums; }
    .led-flow-pos { color:var(--pos,#1a8d3e); }
    .led-flow-neg { color:var(--neg,#d11); }
    .led-day {
        grid-column:1/-1; font-weight:600; font-size:13px; opacity:.65;
        margin:8px 2px 1px; cursor:pointer;
    }
    .led-day-chev { display:inline-block; width:1.1em; }
    .led-day-meta { opacity:.6; font-weight:400; }
    .led-e-rev { opacity:.6; }
    .led-entry-meta { white-space:normal; overflow:visible; }
    .led-card-label { opacity:.7; }
    .led-card-drill { cursor:pointer; }
    .led-cell-pos { color:var(--pos,#1a8d3e); }
    .led-section-top { padding-top:10px; }
    .led-empty-cell { opacity:.6; text-align:center; }
    .led-dim { opacity:.6; }
    .led-dim-soft { opacity:.7; }
    .led-trend-bar {
        display:inline-block; height:9px; min-width:3px;
        background:var(--tg-theme-button-color,#3390ec); border-radius:3px; vertical-align:middle;
    }
    .led-center-top { text-align:center; padding-top:6px; }
    .led-cr-body { margin-top:6px; }
    .led-inline-del { border:0; background:none; color:var(--err,#d33); }
    .led-inline-table { width:100%; font-size:13px; }
    .led-inline-table th.txt { text-align:left; }
    .led-svc-add-row { display:flex; gap:6px; align-items:center; padding:2px 0; }
    .led-price-help {
        line-height:1.55; font-size:13px; padding:2px 2px 8px;
        white-space:normal; overflow-wrap:anywhere;
    }
    .led-rate-note-ok { font-size:12px; color:var(--pos,#1a8d3e); }
    .led-rate-note-bad { font-size:12px; color:var(--neg,#d11); }
    body.pro #led-bar .rcard, body.pro #led-bar .dcard { padding:7px 9px; }
    body.pro #led-bar .card-h { font-size:13px; line-height:1.25; margin-bottom:3px; }
    body.pro #led-bar .fin { font-size:12px; line-height:1.24; }
    body.pro #led-bar .frow { gap:6px; margin-bottom:4px; }
    body.pro #led-bar .fbtns { gap:6px; margin-top:6px; }
    body.pro #led-bar .fbtns button { min-height:26px; padding:4px 9px; font-size:12px; }
    body.pro #led-bar .led-w8ch,
    body.pro #led-bar .led-w9ch,
    body.pro #led-bar .led-w12ch,
    body.pro #led-bar .led-w18ch {
        flex:0 0 auto; max-width:none;
    }
    /* §ui: подпись поля с расшифровкой — пунктир, тап показывает пояснение */
    .fh-l { text-decoration:underline dotted; text-underline-offset:2px; cursor:help; }
    table.mini { width:100%; border-collapse:collapse; }
    table.mini th, table.mini td { border:none; border-bottom:1px solid #8882;
        padding:4px 6px; font-size:13px; white-space:normal; }
    table.mini th { position:static; background:transparent; font-size:11px;
        color:var(--tg-theme-hint-color,#888); text-align:right; }
    table.mini th.txt { text-align:left; }
    table.mini tr:last-child td { border-bottom:none; }
    /* Dashboard grid + Lite home → ecosystem_dashboard.css. */
    /* §19 N+2: Pro mode (tablet/desktop ≥900px or forced in Settings) — multi-column
 card grids and roomier modals; Lite (phone) keeps the single column. */
    body.pro #led-cards {
        display:grid; grid-template-columns:repeat(auto-fill, minmax(340px, 1fr));
        gap:8px; align-items:start; }
    body.pro #refs-list {
        display:grid; grid-template-columns:repeat(3,minmax(0,1fr));
        gap:6px; align-items:start;
    }
    body.pro #refs-list.refs-view-edit { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
    body.pro #deals-cards {
        display:grid; grid-template-columns:repeat(3, minmax(0, 1fr));
        gap:8px; align-items:start; }
    @media (max-width:1080px) {
      body.pro #deals-cards { grid-template-columns:repeat(2, minmax(0, 1fr)); }
      body.pro #refs-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
      body.pro #refs-list.refs-view-edit { grid-template-columns:1fr; }
    }
    body.pro .dcard, body.pro .rcard { margin-bottom:0; }
    body.pro .more-row, body.pro .hint-pad, body.pro .led-span { grid-column:1 / -1; }
    body.pro .rf-extra-block {
        display:grid; grid-template-columns:repeat(2,minmax(0,1fr));
        gap:5px 7px;
    }
    body.pro .rf-extra-block .frow {
        display:grid; grid-template-columns:1fr; align-items:stretch; gap:4px; margin-bottom:0;
    }
    body.pro .rf-extra-block .frow > label {
        flex:0 0 auto; min-width:0; font-size:9px; line-height:1.2;
        white-space:nowrap; overflow:hidden; text-overflow:ellipsis; opacity:.86;
    }
    body.pro .rf-extra-block .frow > input,
    body.pro .rf-extra-block .frow > select { flex:1 1 auto; width:100%; max-width:none; }
    body.pro .rf-extra-block .rf-margin-row {
        display:grid; grid-template-columns:minmax(58px,auto) minmax(0,1fr) minmax(0,1fr);
        align-items:center; gap:6px;
    }
    body.pro .rf-extra-block .rf-margin-row > label {
        font-size:10px; line-height:1.15; opacity:.78; white-space:nowrap;
    }
    body.pro .rf-extra-block .rf-margin-row > input { max-width:none; width:100%; }
    body.pro .rf-extra-block .fin { grid-column:1 / -1; margin-top:0; }
    /* KPI tiles: roomier floor on desktop so labels like «Открытых сделок» / «Долг
 поставщикам» wrap onto a tidy second row instead of ellipsis-truncating. */
    /* §ui-audit (owner 2026-07-04): the overview tiles didn't grow (flex-grow 0), so on a wide pane
 they left a trailing gap. Let them fill the row evenly — no wasted band beside/under them. */
    body.pro .ovt { min-width:120px; flex:1 1 150px; }
    body.pro .ovl { white-space:normal; }
    body.pro .modal { max-width:720px; min-width:520px; }
    body.pro .overlay .modal {
        max-height:calc(100vh - 34px); overflow:auto;
        padding:12px 12px 10px;
    }
    body.pro .overlay .modal .frow { margin-bottom:5px; }
    body.pro .overlay .modal .dc-acts .act,
    body.pro .overlay .modal .dc-acts .del,
    body.pro .overlay .modal .dc-acts .rk {
        min-height:24px; padding:2px 7px; font-size:12px;
    }
    body.pro .overlay .modal .fbtns { gap:6px; margin-top:6px; }
    body.pro .overlay .modal .fbtns button { min-height:28px; padding:5px 10px; font-size:12px; }
    body.pro #tabs .tab { padding:6px 10px; }
    /* §ui: on desktop, action buttons were each stretched to fill the row (the 600px-wide
 «Взаимный баланс / Оценить / Отключить» bars). Cap them and left-align — pill-sized, not
 bars. Phone (lite) keeps full-width tap targets. */
    body.pro .fbtns { justify-content:flex-start; flex-wrap:wrap; }
    body.pro .fbtns button { flex:0 1 auto; min-width:130px; max-width:260px; }
    /* §ui: on desktop, form fields (new-deal form, modals) stretched a single number/select to
 ~1200px. Cap to a sane field width with a fixed-width label — a tidy form, not giant boxes.
 Phone (lite) keeps the full-width 36%/flex:1 layout. Textareas stay wider for free text. */
    body.pro .frow > label { flex:0 0 200px; }
    body.pro .frow > input, body.pro .frow > select { flex:0 1 380px; max-width:380px; }
    body.pro .frow > textarea { flex:0 1 560px; max-width:560px; }
    /* §card-form: inside compact cards (ref/client/deal cards) the fixed 200px label is too
 greedy — it squeezed selects like «— без реферала —» to a truncated sliver. Let the label
 hug its text and the field take the rest of the card width. */
    body.pro .rcard .frow > label, body.pro .dcard .frow > label { flex:0 0 auto; min-width:74px; }
    body.pro .rcard .frow > select, body.pro .rcard .frow > input,
    body.pro .dcard .frow > select, body.pro .dcard .frow > input { flex:1 1 auto; }
    /* §price-narrow: keep the few-column rate/margin/tariff tables compact on desktop instead
 of spreading them across the full pane with big empty gaps. */
    body.pro #grid.price-narrow { max-width:820px; width:100%; }
    /* §fee-tiers: prose cells inside the Тарифы sub-tab (description paragraph + per-pair
 warning line) must wrap instead of overflowing — they are long sentences, not data cells. */
    .ft-prose { white-space:normal; overflow-wrap:break-word; word-break:normal; }
    td.led-fee-hint {
        min-width:0; white-space:normal; overflow-wrap:break-word; word-break:normal;
        line-height:1.4; text-align:left; color:var(--tg-theme-text-color,#222);
    }
    .led-derived-formula, .led-fee-hint .led-hint-sub { display:block; }
    .led-derived-formula { font-weight:600; opacity:.78; }
    .led-fee-hint .led-hint-sub {
        margin-top:3px; color:var(--tg-theme-hint-color,#68717d);
    }
    /* Desktop keeps full-width scalable frames; each screen controls its own internal density. */
    @media (min-width:900px) {
      html { background: var(--tg-theme-bg-color,#fff); }
      body { max-width:none; width:100%; margin-inline:0; }
    }
