/* Extracted from ecosystem.css — Shared chips, header chrome and control primitives. */
/* Load after ecosystem.css and before existing ecosystem feature sheets; original order preserved. */

    /* Action chips (refs / ledger / platform / dashboard): comfortable mobile tap target. */
    .rk { font:inherit; padding:0 var(--ui-space-3, 12px); min-height:var(--ui-control-h, 44px);
        line-height:1.15; border:none; border-radius:var(--ui-radius-sm, 8px); cursor:pointer;
        display:inline-flex; align-items:center; justify-content:center; gap:var(--ui-space-2, 8px);
        font-weight:650; background: var(--tg-theme-secondary-bg-color,#eee); color:inherit; }
    .rk:disabled { opacity:.5; }
    .btn { font:inherit; padding:6px 10px; min-height:30px; line-height:1.15; border:none;
        border-radius:8px; cursor:pointer; background:var(--tg-theme-secondary-bg-color,#eee); color:inherit; }
    .btn:disabled { opacity:.5; }
    body.pro .btn { font-size:12px; }
    .rk.active {
        background: var(--ui-accent-solid, color-mix(in srgb, var(--tg-theme-button-color,#3390ec) 44%, #041525));
        color: var(--ui-on-accent, #fff);
    }
    /* §ui design-system: action chips — a neutral pill + a severity-coloured LEFT edge instead of
 10 clashing fills. alert = problem, warn = needs you / money owed, info = work / opportunity. */
    .rk.chip-alert { border-left:3px solid var(--neg,#d11); }
    .rk.chip-warn  { border-left:3px solid #e6a23c; }
    .rk.chip-info  { border-left:3px solid var(--tg-theme-button-color,#3390ec); }
    .rk.chip-alert b, .rk.chip-warn b, .rk.chip-info b { font-variant-numeric:tabular-nums; }
    /* Ledger sheet picker: 3 groups on top, the active group's sheets below (wrap, no h-scroll). */
    #led-sheets { display:block; overflow:visible; }
    .led-grps { display:flex; gap:6px; margin-bottom:6px; flex-wrap:wrap; align-items:center; }
    /* §ui: второй ряд — ПОДЧИНЁННЫЕ листы группы: отступ + линия слева и чуть мельче,
 чтобы два ряда чипов не читались как один сплошной. */
    .led-shs { display:flex; gap:6px; flex-wrap:wrap; margin-left:4px; padding-left:8px;
        border-left:2px solid var(--tg-theme-hint-color,#dfe3e8); }
    .led-shs .rk { font-size:13px; }
    .led-grps .rk, .led-shs .rk { flex:0 0 auto; white-space:nowrap; }
    .led-shs:empty { display:none; }
    .led-shortcuts { display:flex; gap:5px; flex-wrap:wrap; margin-bottom:5px; }
    .led-shortcuts .fin { align-self:center; opacity:.6; font-size:11px; }
    .led-quick-row { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:2px 0 6px; }
    /* Flowing pill rows. Keep .reg-seg / .appearance-toggle at gap:0. */
    .chip-row, .help-related {
        display:flex; flex-wrap:wrap; align-items:center; gap:var(--ui-space-2, 8px);
    }
    .help-related { margin:10px 0 0; }
    p:not(.help-related) > .rk + .rk { margin-inline-start: var(--ui-space-2, 8px); }
    .led-sc-tg { opacity:.82; font-size:12px; min-height:30px; padding:4px 10px; }
    .led-ctx {
        margin-bottom:6px; font-size:12px; color:var(--tg-theme-hint-color,#777);
        white-space:normal; line-height:1.35;
    }
    .rk.grp { font-weight:600; }
    #led-sheets .led-room-tabs {
        display:flex; flex-wrap:wrap; align-items:stretch; gap:0;
        margin:0 0 6px; padding:0; background:transparent;
        border-bottom:1px solid var(--ui-border,rgba(127,127,127,.22));
    }
    #led-sheets .led-room-tabs .rk.grp {
        flex:0 0 auto; min-height:40px; padding:0 10px; border:0 none !important;
        border-radius:0; border-bottom:2px solid transparent !important; margin-bottom:-1px;
        background:transparent !important; box-shadow:none !important;
        color:var(--tg-theme-hint-color,#8e8e93); font-weight:550;
    }
    #led-sheets .led-room-tabs .rk.grp.active {
        background:transparent !important; color:var(--tg-theme-link-color,#3390ec) !important;
        font-weight:700; border-bottom-color:currentColor !important;
    }
    @media (max-width:700px) {
        #led-sheets .led-room-tabs { flex-wrap:nowrap; width:100%; }
        #led-sheets .led-room-tabs .rk.grp {
            flex:1 1 0; min-width:0; padding:0 4px; font-size:13px;
        }
    }
    /* Drill-down rows: tap an asset/position row to see its movements. */
    tr.drill { cursor:pointer; }
    tr.drill:active td { background: var(--tg-theme-secondary-bg-color,#eee); }
    tr.drill td:first-child { color: var(--tg-theme-link-color,#3390ec); }
    #ref-add { flex:1; min-width:0; }
    button.del { font:inherit; padding:2px 8px; border:none; border-radius:8px; cursor:pointer;
        background:#e74c3c33; }
    button.del:disabled { opacity:.4; cursor:default; }
    .badge { font-size:11px; padding:1px 6px; border-radius:8px; background:#8884; }
    /* Dashboard workspace styles extracted to ecosystem_dashboard.css. */
    html[data-theme="dark"] #hdr {
        background:
            radial-gradient(circle at 0 0, rgba(98,160,219,.18), transparent 40%),
            linear-gradient(120deg, #223346, #1d2b39 55%, #263646);
        border-color:rgba(143,163,181,.30);
        box-shadow:0 10px 30px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.08);
    }
    html[data-theme="dark"] #hdr .hdr-btn,
    html[data-theme="dark"] #hdr .appearance-toggle,
    html[data-theme="dark"] #hdr #search-btn,
    html[data-theme="dark"] #hdr #status,
    html[data-theme="dark"] #hdr .tn-switch {
        background:rgba(12,22,34,.52);
        border-color:rgba(143,163,181,.34);
        color:var(--tg-theme-text-color,#f5f5f5);
    }
    html[data-theme="dark"] #hdr .appearance-segment:not(.active) {
        color:rgba(245,245,245,.82);
    }
    html:not([data-theme="dark"]) #hdr {
        background:linear-gradient(125deg,
          color-mix(in srgb,var(--tg-theme-button-color,#3390ec) 7%,var(--app-surface)),
          var(--tg-theme-bg-color,#fff) 42%,
          color-mix(in srgb,var(--tg-theme-secondary-bg-color,#f1f1f1) 42%,var(--app-surface)));
        border-color:color-mix(in srgb,var(--tg-theme-button-color,#3390ec) 24%,var(--app-border-strong));
    }
    /* Shared pill switcher: Cash, Capital, Price, Network sheets;
       Book Журнал/Отчёты/Аудит; Summary Остатки/Нетто FX;
       Deals Карточки/Список/Таблица (wide Pro). */
    .led-shs-switch .rk:nth-last-child(n+5),
    .led-shs-switch .rk:nth-last-child(n+5) ~ .rk {
        min-width: 56px; padding: 0 10px;
    }
    #led-sheets .led-shs-inner {
        margin: 4px 0 0;
    }
    .led-shs-switch {
        display: flex; align-items: center; justify-content: stretch;
        margin: 0; padding: 3px; gap: 0; flex-wrap: nowrap;
        border: 1px solid #9aa4ae66; border-radius: 999px; background: #0a1628;
    }
    .led-shs.led-shs-switch {
        margin-left: 0; padding-left: 3px; border-left: 0;
    }
    .led-shs-switch .rk {
        min-height: 40px; min-width: 76px; padding: 0 16px; border-radius: 999px;
        font-weight: 650; background: transparent !important; box-shadow: none !important;
        color: #dce6ee !important;
    }
    .led-shs-switch .rk.active { background: #d7e6ee !important; color: #0b1a28 !important; }
    body.lite .led-shs-switch .rk { flex: 1 1 0; min-height: 44px; }
    /* Dashboard dark financial chrome → ecosystem_dashboard.css. */
    @media (min-width: 701px) {
        body.pro .led-focus-tabs:has(.led-shs-switch),
        #led-sheets:has(> .led-shs-switch) {
            display: flex; flex-flow: row wrap; align-items: center;
            justify-content: space-between; gap: 8px;
        }
        body.pro .led-focus-tabs:has(.led-shs-switch) .led-grps,
        #led-sheets:has(> .led-shs-switch) .led-grps { margin-bottom: 0; }
        #led-sheets .led-shs.led-shs-switch {
            display: flex; justify-content: flex-end; align-items: center; margin: 0 0 0 auto;
            padding: 3px; gap: 0; border: 1px solid #9aa4ae66; border-radius: 999px; background: #0a1628;
        }
        #led-sheets .led-shs-switch .rk {
            min-height: 40px; min-width: 76px; padding: 0 16px; border-radius: 999px; font-weight: 650;
            background: transparent !important; box-shadow: none !important; color: #dce6ee !important;
        }
        #led-sheets .led-shs-switch .rk:nth-last-child(n+5),
        #led-sheets .led-shs-switch .rk:nth-last-child(n+5) ~ .rk {
            min-width: 56px; padding: 0 10px;
        }
        #led-sheets .led-shs-switch .rk.active { background: #d7e6ee !important; color: #0b1a28 !important; }
        #led-sheets .led-shs-inner { flex: 1 1 100%; }
    }
