/* Extracted from ecosystem.css — Counterparty compact list residuals. */
/* Load after ecosystem.css and before existing ecosystem feature sheets; original order preserved. */

/* Migrated from legacy app.css (dual-era): surface workspaces + mid-era UI. */
/* Keep before .ecosystem-workspace overrides; dark grow-field chrome stays in app.css. */
    /* Deals registry (.reg-*, #grid.deals-registry) → ecosystem_deals.css. */
    /* references */
    #refs-bar { position:relative; margin-bottom:8px; }
    #ref-kinds { display:inline-flex; gap:5px; flex-wrap:wrap; width:auto; max-width:100%; margin-bottom:5px; }
    #ref-kinds .rk { min-height:32px; padding:5px 10px; font-size:12px; }
    .ref-bar2 {
        display:grid; grid-template-columns:minmax(170px,1fr) auto auto auto;
        gap:5px; align-items:center; margin:5px 0 3px;
    }
    .ref-filter { min-width:0; width:100%; min-height:33px; box-sizing:border-box; }
    .ref-view-toggle { display:flex; gap:3px; padding:2px; border-radius:9px; background:rgba(127,127,127,.065); }
    .ref-view-toggle .rv { display:flex; align-items:center; gap:4px; min-height:29px; padding:4px 8px; font-size:11px; }
    .ref-create { position:relative; z-index:12; }
    .ref-create > summary { list-style:none; cursor:pointer; min-height:31px; padding:5px 9px; white-space:nowrap; }
    .ref-create > summary::-webkit-details-marker { display:none; }
    .ref-create[open] > summary { box-shadow:inset 0 0 0 1px rgba(51,144,236,.28); }
    .ref-create-popover {
        position:absolute; right:0; top:calc(100% + 4px); z-index:13;
        display:grid; grid-template-columns:minmax(210px,300px) auto; gap:5px;
        width:max-content; max-width:calc(100vw - 24px); padding:7px;
        border:1px solid rgba(127,127,127,.20); border-radius:10px;
        background:var(--tg-theme-bg-color,#fff); box-shadow:0 14px 36px rgba(0,0,0,.18);
    }
    .ref-create:not([open]) .ref-create-popover { display:none; }
    .ref-create-popover input, .ref-create-popover button { min-height:34px; box-sizing:border-box; }
    .ref-context {
        display:flex; align-items:center; gap:7px; min-height:18px; margin:2px 1px 5px;
        color:var(--ui-muted-strong, color-mix(in srgb, var(--tg-theme-text-color,#111) 90%, #1f2937));
        font-size:12px;
    }
    .ref-context b { color:var(--tg-theme-text-color,#20242a); font-size:12px; }
    #refs-list .refs-pager-strip { grid-column:1 / -1; margin-bottom:2px; }
    .refs-pager-strip .rk { min-height:24px; padding:2px 7px; font-size:11px; }
    .rf-row-compact, .rf-card-edit {
        position:relative; margin:0; border:1px solid rgba(127,127,127,.18);
        border-radius:11px; background:var(--tg-theme-bg-color,#fff);
        box-shadow:0 2px 9px rgba(31,43,61,.045);
    }
    .rf-row-compact {
        min-width:0; min-height:70px; padding:8px 9px; cursor:pointer;
        transition:border-color .15s, box-shadow .15s, transform .15s;
    }
    .rf-row-compact:hover, .rf-row-compact:focus-visible {
        outline:none; border-color:rgba(51,144,236,.42);
        box-shadow:0 6px 18px rgba(31,83,140,.10); transform:translateY(-1px);
    }
    .rf-row-head { display:flex; align-items:center; gap:7px; min-width:0; }
    .rf-kind-icon {
        display:grid; place-items:center; flex:0 0 24px; width:24px; height:24px;
        border-radius:8px; background:rgba(51,144,236,.09); font-size:12px;
    }
    .rf-row-identity { display:flex; align-items:baseline; gap:5px; min-width:0; }
    .rf-id {
        flex:0 0 auto;
        color:var(--ui-muted-strong, color-mix(in srgb, var(--tg-theme-text-color,#111) 90%, #1f2937));
        font-size:11px; font-weight:650;
    }
    .rf-row-name {
        min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
        font-size:12px; line-height:1.2;
    }
    .rf-row-open { margin-left:auto; color:var(--ui-muted-strong, #3f4b5a); font-size:17px; line-height:1; }
    .rf-badges { display:flex; align-items:center; gap:3px; flex-wrap:wrap; margin-top:6px; }
    .rf-badge {
        padding:2px 5px; border-radius:999px; background:rgba(127,127,127,.075);
        color:var(--ui-muted-strong, color-mix(in srgb, var(--tg-theme-text-color,#111) 90%, #1f2937));
        font-size:11px; line-height:1.2; white-space:nowrap; opacity:1;
    }
    .rf-badge.is-info { color:#145a96; background:rgba(51,144,236,.14); }
    .rf-badge.is-warn { color:#8a5410; background:rgba(224,151,45,.16); }
    .rf-badge.is-muted { opacity:1; color:var(--ui-muted-strong, #3f4b5a); }
    .rf-last {
        margin-top:5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
        color:var(--ui-muted-strong, color-mix(in srgb, var(--tg-theme-text-color,#111) 90%, #1f2937));
        font-size:11px;
    }
    .rf-card-edit { min-width:0; padding:8px; }
    .rf-edit-head { display:flex; align-items:center; gap:6px; margin-bottom:5px; }
    .rf-edit-head .rf-autosave {
        margin-left:auto;
        color:var(--ui-muted-strong, color-mix(in srgb, var(--tg-theme-text-color,#111) 90%, #1f2937));
        font-size:11px; text-transform:uppercase; letter-spacing:.03em;
    }
    .rf-card-edit .rf-name-row { margin:0 0 3px; }
    .rf-card-edit .rf-name-row input { width:100%; min-height:32px; box-sizing:border-box; font-weight:650; }
    .rf-extra-block { margin-top:6px; }
    .rf-extra-row { margin-top:4px; }
    .rf-margin-row > label { min-width:62px; }
    .rf-margin-row > input { flex:0 1 9ch; max-width:11ch; }
    .rf-card-acts { align-items:center; justify-content:space-between; margin-top:7px; }
    .rf-card-acts > .rf-info { flex:1 1 auto; }
    .rf-more { position:relative; flex:0 0 auto; }
    .rf-more > summary { list-style:none; cursor:pointer; }
    .rf-more > summary::-webkit-details-marker { display:none; }
    .rf-more-menu {
        position:absolute; right:0; bottom:calc(100% + 4px); z-index:10;
        min-width:140px; padding:5px; border:1px solid rgba(127,127,127,.18);
        border-radius:9px; background:var(--tg-theme-bg-color,#fff); box-shadow:0 10px 28px rgba(0,0,0,.16);
    }
    .rf-more-menu button { width:100%; min-height:30px; text-align:left; }
    .ref-empty-state {
        grid-column:1 / -1; display:flex; flex-direction:column; align-items:center;
        justify-content:center; gap:5px; min-height:150px; padding:20px;
        border:1px dashed rgba(127,127,127,.22); border-radius:12px;
        color:var(--tg-theme-hint-color,#737c86); text-align:center;
    }
    .ref-empty-state b { color:var(--tg-theme-text-color,#20242a); font-size:13px; }
    .ref-empty-state > span:not(.ref-empty-icon) { max-width:360px; font-size:11px; line-height:1.4; }
    .ref-empty-icon {
        display:grid; place-items:center; width:34px; height:34px; border-radius:11px;
        background:rgba(51,144,236,.09); font-size:17px;
    }
