.channel-cost-root,
.channel-cost-shell {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.channel-cost-toolbar {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .7rem;
    padding: .9rem 8.4rem 1rem 1rem;
    border-radius: .9rem;
    background: #fff;
    border: 1px solid #e5eaf1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.channel-cost-alert {
    position: absolute;
    top: .72rem;
    right: .8rem;
    z-index: 7;
}

.channel-cost-alert-btn {
    display: inline-flex;
    align-items: center;
    gap: .32rem;
    border: 1px solid #dbe4f0;
    background: #fff;
    color: #334155;
    padding: .34rem .62rem;
    border-radius: .55rem;
    font-size: .76rem;
    font-weight: 650;
    cursor: pointer;
    line-height: 1;
}

.channel-cost-alert-btn:hover,
.channel-cost-alert.is-open .channel-cost-alert-btn,
.channel-cost-alert:hover .channel-cost-alert-btn {
    color: #0d6efd;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.channel-cost-alert-pop {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + .45rem);
    width: 22.5rem;
    max-width: min(22.5rem, calc(100vw - 2rem));
    padding: .85rem .9rem .9rem;
    border-radius: .8rem;
    background: #fff;
    border: 1px solid #e5eaf1;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .16);
    z-index: 12;
}

.channel-cost-alert-pop::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: .5rem;
}

.channel-cost-alert-pop::after {
    content: "";
    position: absolute;
    right: 1.1rem;
    bottom: 100%;
    border: 7px solid transparent;
    border-bottom-color: #fff;
    filter: drop-shadow(0 -1px 0 #e5eaf1);
}

.channel-cost-alert:hover .channel-cost-alert-pop,
.channel-cost-alert:focus-within .channel-cost-alert-pop,
.channel-cost-alert.is-open .channel-cost-alert-pop {
    display: block;
}

.channel-cost-alert-title {
    font-size: .84rem;
    font-weight: 750;
    color: #0f172a;
}

.channel-cost-alert-hint {
    margin: .28rem 0 .5rem;
    font-size: .72rem;
    color: #64748b;
    line-height: 1.5;
}

.channel-cost-alert-meta {
    margin-bottom: .65rem;
    font-size: .7rem;
    color: #94a3b8;
}

.channel-cost-alert-switch {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .78rem;
    font-weight: 650;
    color: #334155;
    margin-bottom: .65rem;
}

.channel-cost-alert-field {
    display: flex;
    flex-direction: column;
    gap: .28rem;
    margin-bottom: .65rem;
    font-size: .72rem;
    font-weight: 700;
    color: #64748b;
}

.channel-cost-alert-field textarea,
.channel-cost-alert-bot input {
    width: 100%;
    border: 1px solid #e5eaf1;
    border-radius: .5rem;
    padding: .42rem .55rem;
    font-size: .8rem;
    font-weight: 500;
    color: #0f172a;
    background: #f8fafc;
}

.channel-cost-alert-field textarea:focus,
.channel-cost-alert-bot input:focus {
    outline: none;
    border-color: #93c5fd;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .12);
}

.channel-cost-alert-bots-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .72rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: .35rem;
}

.channel-cost-alert-link {
    border: 0;
    background: transparent;
    color: #0d6efd;
    font-size: .72rem;
    font-weight: 700;
    padding: 0;
    cursor: pointer;
}

.channel-cost-alert-link.is-danger { color: #dc2626; }

.channel-cost-alert-bot {
    display: flex;
    flex-direction: column;
    gap: .32rem;
    margin-bottom: .5rem;
    padding: .5rem;
    border-radius: .55rem;
    background: #f8fafc;
    border: 1px solid #eef2f7;
}

.channel-cost-alert-bot-row {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.channel-cost-alert-bot-row input { flex: 1; }

.channel-cost-alert-empty {
    font-size: .74rem;
    color: #94a3b8;
    margin-bottom: .5rem;
}

.channel-cost-alert-actions {
    display: flex;
    justify-content: flex-end;
    gap: .4rem;
    margin-top: .35rem;
    flex-wrap: nowrap;
}

.channel-cost-alert-actions .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.channel-cost-alert-status {
    margin-top: .5rem;
    font-size: .72rem;
    color: #0369a1;
    line-height: 1.45;
}

.channel-cost-alert-status.is-error { color: #dc2626; }

.channel-cost-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem .65rem;
}

.channel-cost-pills {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem;
    padding: .22rem;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid #e5eaf1;
}

.channel-cost-filter-label {
    flex: 0 0 2.4rem;
    font-size: .72rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.channel-cost-pill {
    border: 0;
    background: transparent;
    color: #64748b;
    padding: .38rem .78rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 650;
    cursor: pointer;
    transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

.channel-cost-pill:hover {
    color: #0f172a;
    background: rgba(15, 23, 42, .05);
}

.channel-cost-pill.is-active {
    color: #0d6efd;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

.channel-cost-search {
    margin-left: auto;
    min-width: 16rem;
    flex: 1 1 16rem;
    max-width: 22rem;
    height: 2.15rem;
    border: 1px solid #e5eaf1;
    border-radius: 999px;
    padding: 0 .95rem;
    font-size: .84rem;
    color: #0f172a;
    background: #f8fafc;
}

.channel-cost-search:focus {
    outline: none;
    border-color: #93c5fd;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .12);
}

.channel-cost-groups {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.channel-cost-group {
    position: relative;
    border-radius: 1rem;
    background: #fff;
    border: 1px solid #e5eaf1;
    overflow: visible;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.channel-cost-group-head {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 1.15rem;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border-bottom: 1px solid #eef2f7;
    border-radius: 1rem 1rem 0 0;
}

.channel-cost-group-heading {
    min-width: 0;
}

.channel-cost-group-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 750;
    color: #0f172a;
}

.channel-cost-group-count {
    margin-top: .12rem;
    font-size: .72rem;
    color: #94a3b8;
}

.channel-cost-group-actions {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-shrink: 0;
}

.channel-cost-icon-btn {
    display: inline-flex;
    align-items: center;
    gap: .32rem;
    border: 1px solid #e5eaf1;
    background: #fff;
    color: #475569;
    padding: .32rem .62rem;
    border-radius: .55rem;
    font-size: .76rem;
    font-weight: 650;
    cursor: pointer;
    line-height: 1;
}

.channel-cost-icon-btn:hover {
    color: #0d6efd;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.channel-cost-icon-btn time {
    color: #64748b;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.channel-cost-icon-btn.is-square {
    width: 1.95rem;
    height: 1.95rem;
    padding: 0;
    justify-content: center;
}

.channel-cost-docs {
    position: relative;
}

.channel-cost-docs-pop {
    display: none;
    position: absolute;
    right: 0;
    bottom: calc(100% + .45rem);
    top: auto;
    min-width: 16rem;
    max-width: 26rem;
    padding: .7rem .75rem;
    border-radius: .7rem;
    background: #fff;
    border: 1px solid #e5eaf1;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .14);
    z-index: 12;
}

.channel-cost-docs-pop::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    bottom: auto;
    height: .5rem;
}

.channel-cost-docs-pop::after {
    content: "";
    position: absolute;
    right: .7rem;
    top: 100%;
    bottom: auto;
    border: 7px solid transparent;
    border-top-color: #fff;
    filter: drop-shadow(0 1px 0 #e5eaf1);
}

.channel-cost-docs:hover .channel-cost-docs-pop,
.channel-cost-docs:focus-within .channel-cost-docs-pop {
    display: block;
}

.channel-cost-docs-title {
    font-size: .72rem;
    font-weight: 750;
    color: #94a3b8;
    margin-bottom: .4rem;
}

.channel-cost-docs-list {
    display: flex;
    flex-direction: column;
    gap: .28rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.channel-cost-docs-list a {
    display: block;
    font-size: .76rem;
    color: #334155;
    text-decoration: none;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.4;
}

.channel-cost-docs-list a:hover { color: #0d6efd; }

.channel-cost-docs-empty {
    font-size: .74rem;
    color: #94a3b8;
}

.channel-cost-ico {
    width: .92rem;
    height: .92rem;
    flex: 0 0 auto;
}

.channel-cost-update {
    position: relative;
}

.channel-cost-update-pop {
    display: none;
    position: absolute;
    right: 0;
    bottom: calc(100% + .5rem);
    min-width: 13.5rem;
    padding: .7rem .75rem;
    border-radius: .7rem;
    background: #fff;
    border: 1px solid #e5eaf1;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .14);
    z-index: 8;
}

.channel-cost-update-pop::after {
    content: "";
    position: absolute;
    right: 1.1rem;
    top: 100%;
    border: 7px solid transparent;
    border-top-color: #fff;
    filter: drop-shadow(0 1px 0 #e5eaf1);
}

.channel-cost-update.is-open .channel-cost-update-pop {
    display: block;
}

.channel-cost-official-link {
    display: inline-flex;
    align-items: center;
    gap: .32rem;
    color: #334155;
    text-decoration: none;
    font-size: .8rem;
    font-weight: 650;
    margin-bottom: .55rem;
}

.channel-cost-official-link:hover { color: #0d6efd; }
.channel-cost-official-link.is-disabled {
    color: #94a3b8;
    cursor: default;
}

.channel-cost-sync-btn {
    width: 100%;
}

.channel-cost-sync-btn.is-disabled,
.channel-cost-sync-btn:disabled {
    opacity: .65;
}

.channel-cost-sync-hint {
    margin-top: .45rem;
    font-size: .72rem;
    color: #94a3b8;
    line-height: 1.4;
}

.channel-cost-row {
    display: grid;
    grid-template-columns: minmax(15rem, 20rem) minmax(0, 1fr);
    gap: 1.1rem;
    padding: 1.05rem 1.15rem 1.15rem;
    border-top: 1px solid #f1f5f9;
    overflow: visible;
}

.channel-cost-row:first-of-type {
    border-top: 0;
}

.channel-cost-identity {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    overflow: visible;
}

.channel-cost-name {
    font-size: .98rem;
    font-weight: 750;
    color: #0f172a;
    line-height: 1.3;
}

.channel-cost-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .74rem;
    color: #94a3b8;
    word-break: break-all;
}

.channel-cost-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    overflow: visible;
}

.channel-cost-chip {
    display: inline-flex;
    align-items: center;
    padding: .12rem .5rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .01em;
    border: 1px solid #e5eaf1;
    background: #f8fafc;
    color: #475569;
}

.channel-cost-chip.is-type { color: #1d4ed8; background: #eff6ff; border-color: #dbeafe; }
.channel-cost-chip.is-cny { color: #0f766e; background: #f0fdfa; border-color: #ccfbf1; }
.channel-cost-chip.is-usd { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.channel-cost-chip.is-credit { color: #7c3aed; background: #f5f3ff; border-color: #ddd6fe; }
.channel-cost-chip.is-partial {
    color: #b45309;
    background: #fffbeb;
    border-color: #fde68a;
}
.channel-cost-chip.is-partial::before {
    content: "";
    width: .42rem;
    height: .42rem;
    border-radius: 50%;
    background: #fbbf24;
    margin-right: .28rem;
}
.channel-cost-chip.is-applied { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }
.channel-cost-chip.is-unused { color: #64748b; background: #f8fafc; border-color: #e2e8f0; }

.channel-cost-applied {
    position: relative;
    z-index: 1;
}

.channel-cost-applied:hover,
.channel-cost-applied:focus-within {
    z-index: 20;
}

.channel-cost-applied-pop {
    display: none;
    position: absolute;
    right: 100%;
    left: auto;
    top: -0.35rem;
    margin-right: .55rem;
    margin-left: 0;
    width: 16.5rem;
    max-height: 18rem;
    overflow: auto;
    padding: .7rem .75rem;
    border-radius: .7rem;
    background: #fff;
    border: 1px solid #e5eaf1;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .16);
    z-index: 12;
    font-weight: 500;
    color: #334155;
    text-align: left;
}

.channel-cost-applied-pop::before {
    content: "";
    position: absolute;
    right: -7px;
    left: auto;
    top: .7rem;
    border: 7px solid transparent;
    border-left-color: #fff;
    filter: drop-shadow(1px 0 0 #e5eaf1);
}

.channel-cost-applied:hover .channel-cost-applied-pop,
.channel-cost-applied:focus-within .channel-cost-applied-pop {
    display: block;
}

.channel-cost-applied-title {
    font-size: .72rem;
    font-weight: 750;
    color: #94a3b8;
    margin-bottom: .45rem;
}

.channel-cost-applied-item + .channel-cost-applied-item {
    margin-top: .55rem;
    padding-top: .55rem;
    border-top: 1px dashed #eef2f7;
}

.channel-cost-applied-name {
    font-size: .8rem;
    font-weight: 750;
    color: #0f172a;
}

.channel-cost-applied-sub {
    font-size: .7rem;
    color: #94a3b8;
    margin-top: .08rem;
}

.channel-cost-applied-prices {
    margin: .28rem 0 0;
    padding-left: 1rem;
    font-size: .72rem;
    color: #475569;
    line-height: 1.45;
}

.channel-cost-applied-empty {
    font-size: .74rem;
    color: #94a3b8;
}

.channel-cost-formula {
    font-size: .76rem;
    color: #64748b;
    line-height: 1.45;
}

.channel-cost-convert {
    margin-top: .12rem;
    padding: .45rem .55rem;
    border: 1px solid #e8eef5;
    border-radius: .55rem;
    background: #f8fafc;
}

.channel-cost-convert-title {
    font-size: .74rem;
    font-weight: 750;
    color: #334155;
}

.channel-cost-convert-note {
    margin-top: .18rem;
    font-size: .68rem;
    color: #94a3b8;
    line-height: 1.4;
}

.channel-cost-convert-rule {
    display: flex;
    align-items: baseline;
    gap: .35rem;
    margin-top: .28rem;
    font-size: .72rem;
    line-height: 1.35;
}

.channel-cost-convert-when {
    color: #64748b;
    min-width: 0;
    flex: 1;
}

.channel-cost-convert-tokens {
    font-weight: 750;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.channel-cost-convert-unit {
    color: #94a3b8;
    white-space: nowrap;
}

.channel-cost-allow {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
}

.channel-cost-allow-badge {
    display: inline-flex;
    align-items: center;
    padding: .16rem .55rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    color: #166534;
    background: #ecfdf3;
    border: 1px solid #bbf7d0;
}

.channel-cost-notes {
    font-size: .72rem;
    color: #94a3b8;
    line-height: 1.4;
}

.channel-cost-matrix {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.channel-cost-comp-pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: .65rem;
    align-items: stretch;
}

.channel-cost-comp {
    position: relative;
    border: 1px solid #eef2f7;
    border-radius: .75rem;
    background: #fbfcfe;
    padding: .7rem 2.4rem .75rem .8rem;
    overflow: hidden;
}

.channel-cost-unit-fold {
    position: absolute;
    top: -1px;
    right: -1px;
    min-width: 1.55rem;
    height: 1.55rem;
    padding: 0 .5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e2eaf3;
    border-top-right-radius: .75rem;
    border-bottom-left-radius: .75rem;
    cursor: default;
    box-sizing: border-box;
}

.channel-cost-unit-fold span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: .62rem;
    font-weight: 800;
    line-height: 1;
    color: #475569;
    letter-spacing: .01em;
    pointer-events: none;
    text-align: center;
    white-space: nowrap;
}

.channel-cost-unit-fold:hover {
    background: #d7e6f8;
}

.channel-cost-comp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .5rem;
}

.channel-cost-comp-title {
    font-size: .78rem;
    font-weight: 750;
    color: #334155;
}

.channel-cost-rate-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.channel-cost-rate-chip {
    display: flex;
    flex-direction: column;
    gap: .12rem;
    min-width: 7.2rem;
    padding: .4rem .55rem;
    border-radius: .55rem;
    background: #fff;
    border: 1px solid #e8eef5;
}

.channel-cost-rate-when {
    font-size: .68rem;
    color: #94a3b8;
    font-weight: 650;
}

.channel-cost-rate-amount {
    font-size: .88rem;
    font-weight: 750;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.channel-cost-rate-cny {
    font-size: .68rem;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}

.channel-cost-peak-card {
    padding-top: .65rem;
}

.channel-cost-peak-caption {
    font-size: .7rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: .04em;
    margin-bottom: .45rem;
}

.channel-cost-peak-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .78rem;
    overflow: hidden;
    border-radius: .55rem;
}

.channel-cost-peak-table th {
    text-align: right;
    font-weight: 750;
    color: #64748b;
    padding: .38rem .55rem .32rem;
    font-size: .72rem;
    background: #f8fafc;
}

.channel-cost-peak-table th small {
    display: block;
    margin-top: .08rem;
    font-size: .62rem;
    font-weight: 650;
    color: #94a3b8;
    letter-spacing: 0;
}

.channel-cost-peak-table th.is-item,
.channel-cost-peak-table th[scope="row"] {
    text-align: left;
    color: #475569;
    font-weight: 650;
    font-family: inherit;
}

.channel-cost-peak-table th[scope="row"] {
    background: transparent;
    font-size: .76rem;
    padding-left: .15rem;
}

.channel-cost-peak-table td {
    padding: .4rem .55rem;
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    vertical-align: middle;
}

.channel-cost-peak-table th.is-off,
.channel-cost-peak-table td.is-off {
    background: #f0fdf4;
    text-align: right;
}

.channel-cost-peak-table th.is-peak,
.channel-cost-peak-table td.is-peak {
    background: #fff7ed;
    text-align: right;
}

.channel-cost-peak-table th.is-off { color: #166534; }
.channel-cost-peak-table th.is-peak { color: #9a3412; }

.channel-cost-peak-amt {
    display: block;
    font-size: .88rem;
    font-weight: 750;
    color: #0f172a;
    line-height: 1.2;
}

.channel-cost-peak-cny {
    display: block;
    margin-top: .08rem;
    font-size: .66rem;
    font-weight: 650;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}

.channel-cost-peak-table tbody tr + tr th,
.channel-cost-peak-table tbody tr + tr td {
    border-top: 1px solid #eef2f7;
}

.channel-cost-empty {
    padding: 2.2rem 1rem;
    text-align: center;
    color: #94a3b8;
    font-size: .9rem;
}

.channel-cost-empty-card {
    padding: 1.6rem;
    border-radius: .9rem;
    background: #fff;
    border: 1px dashed #dbe3ee;
    color: #94a3b8;
    text-align: center;
}

.channel-cost-windows {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
    margin: .75rem 1.15rem .1rem;
}

.channel-cost-window {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    min-width: 0;
    padding: .55rem .7rem;
    border-radius: .7rem;
    border: 1px solid transparent;
}

.channel-cost-window.is-peak {
    background: #fff7ed;
    border-color: #fed7aa;
}

.channel-cost-window.is-off {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.channel-cost-window.is-other {
    background: #f8fafc;
    border-color: #e5eaf1;
}

.channel-cost-window-tag {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    padding: .12rem .45rem;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .04em;
}

.channel-cost-window.is-peak .channel-cost-window-tag {
    color: #9a3412;
    background: #ffedd5;
}

.channel-cost-window.is-off .channel-cost-window-tag {
    color: #166534;
    background: #dcfce7;
}

.channel-cost-window.is-other .channel-cost-window-tag {
    color: #334155;
    background: #e2e8f0;
}

.channel-cost-window-body {
    min-width: 0;
}

.channel-cost-window-main {
    font-size: .78rem;
    font-weight: 650;
    color: #0f172a;
    line-height: 1.4;
}

.channel-cost-window-sub {
    margin-top: .12rem;
    font-size: .68rem;
    color: #64748b;
    line-height: 1.35;
}

.channel-cost-json-dialog .modal-content {
    min-height: 36rem;
}

.channel-cost-json-body {
    display: grid;
    grid-template-columns: 16.5rem minmax(0, 1fr);
    gap: 0;
    padding: 0;
    min-height: 28rem;
}

.channel-cost-json-aside {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding: .7rem;
    border-right: 1px solid #eef2f7;
    background: #f8fafc;
    max-height: 32rem;
    overflow: auto;
}

.channel-cost-json-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .12rem;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: .5rem .6rem;
    border-radius: .55rem;
    cursor: pointer;
}

.channel-cost-json-item:hover { background: #eef4ff; }
.channel-cost-json-item.is-active {
    background: #fff;
    box-shadow: 0 0 0 1px #bfdbfe;
}

.channel-cost-json-item-name {
    font-size: .82rem;
    font-weight: 750;
    color: #0f172a;
}

.channel-cost-json-item-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .68rem;
    color: #94a3b8;
    word-break: break-all;
}

.channel-cost-json-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: .7rem .8rem .8rem;
}

.channel-cost-json-editor {
    --json-font-size: .78rem;
    --json-line-height: 1.45;
    --json-pad-y: .7rem;
    --json-pad-left: .8rem;
    --json-pad-right: 8.6rem;
    position: relative;
    flex: 1 1 auto;
    min-height: 24rem;
    background: #fff;
    border-radius: .55rem;
}

.channel-cost-json-text {
    position: relative;
    z-index: 1;
    display: block;
    min-height: 24rem;
    height: 100%;
    width: 100%;
    border: 1px solid #e5eaf1;
    border-radius: .55rem;
    padding: var(--json-pad-y) var(--json-pad-right) var(--json-pad-y) var(--json-pad-left);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: var(--json-font-size);
    line-height: var(--json-line-height);
    color: #0f172a;
    resize: vertical;
    white-space: pre;
    overflow: auto;
    background: transparent;
    box-sizing: border-box;
    scrollbar-gutter: stable;
}

.channel-cost-json-text:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .12);
}

.channel-cost-json-lines,
.channel-cost-json-hints {
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    bottom: 1px;
    pointer-events: none;
    overflow: hidden;
    border-radius: calc(.55rem - 1px);
    padding: var(--json-pad-y) 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: var(--json-font-size);
    line-height: var(--json-line-height);
    box-sizing: border-box;
}

.channel-cost-json-lines { z-index: 0; }

.channel-cost-json-hints {
    padding: var(--json-pad-y) .5rem var(--json-pad-y) var(--json-pad-left);
    z-index: 2;
}

.channel-cost-json-line {
    height: calc(var(--json-font-size) * var(--json-line-height));
    min-height: calc(var(--json-font-size) * var(--json-line-height));
}

.channel-cost-json-line.is-active {
    background: #e8f1ff;
}

.channel-cost-json-hint-line {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: calc(var(--json-font-size) * var(--json-line-height));
    min-height: calc(var(--json-font-size) * var(--json-line-height));
}

.channel-cost-json-hint-line span {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: .68rem;
    font-weight: 650;
    color: #94a3b8;
    background: none;
    border: 0;
    border-radius: 0;
    padding: 0;
    line-height: 1.35;
    white-space: nowrap;
}

.channel-cost-json-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .7rem;
    flex-wrap: wrap;
}

.channel-cost-json-footer-tools {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.channel-cost-excel-template {
    font-size: .82rem;
    color: #2563eb;
    text-decoration: none;
    white-space: nowrap;
}

.channel-cost-excel-template:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.channel-cost-json-footer-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-left: auto;
}

.channel-cost-json-error {
    margin-top: .55rem;
    font-size: .78rem;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: .45rem;
    padding: .4rem .55rem;
}

@media (max-width: 992px) {
    .channel-cost-windows { grid-template-columns: 1fr; }
    .channel-cost-row { grid-template-columns: 1fr; }
    .channel-cost-comp-pair { grid-template-columns: 1fr; }
    .channel-cost-json-body { grid-template-columns: 1fr; }
    .channel-cost-json-aside {
        max-height: 10rem;
        border-right: 0;
        border-bottom: 1px solid #eef2f7;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    .channel-cost-json-item { min-width: 9rem; }
}

@media (max-width: 576px) {
    .channel-cost-search { max-width: none; margin-left: 0; }
    .channel-cost-group-head { flex-wrap: wrap; }
    .channel-cost-applied-pop {
        left: 0;
        right: auto;
        top: calc(100% + .4rem);
        margin-right: 0;
        width: min(16.5rem, calc(100vw - 2rem));
    }
    .channel-cost-applied-pop::before { display: none; }
}
