.ai-chain-page {
    background: #f4f6f8;
    color: #18212f;
}

.ai-chain-shell {
    max-width: 1760px;
    margin: 0 auto;
    padding: 24px;
}

.ai-chain-hero {
    min-height: 260px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 34px;
    color: #fff;
    background:
        linear-gradient(120deg, rgba(12, 22, 34, 0.88), rgba(15, 68, 77, 0.76)),
        url("https://images.unsplash.com/photo-1518770660439-4636190af475?auto=format&fit=crop&w=2200&q=80");
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(24, 33, 47, 0.16);
}

.ai-chain-hero h1 {
    max-width: 820px;
    margin: 8px 0 12px;
    font-size: clamp(32px, 4vw, 58px);
    line-height: 1.05;
    font-weight: 760;
    letter-spacing: 0;
}

.ai-chain-hero p {
    max-width: 760px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 16px;
}

.desk-label {
    color: #5d6b7c;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ai-chain-hero .desk-label {
    color: #93f0db;
}

.ai-chain-hero__status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    backdrop-filter: blur(12px);
    white-space: nowrap;
}

.desk-icon-button {
    width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 8px;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    cursor: pointer;
}

.chain-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 14px;
    margin: 16px 0;
}

.chain-kpi {
    min-height: 104px;
    padding: 18px;
    background: #fff;
    border: 1px solid #dde4ec;
    border-radius: 8px;
}

.chain-kpi__label {
    color: #667386;
    font-size: 13px;
}

.chain-kpi__value {
    margin-top: 8px;
    font-size: 30px;
    font-weight: 780;
    color: #172033;
}

.chain-kpi__note {
    margin-top: 4px;
    color: #7a8798;
    font-size: 12px;
}

.chain-workbench {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr) 380px;
    gap: 16px;
    align-items: start;
}

.price-trend-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.price-trend-content {
    display: grid;
    gap: 12px;
}

.price-source-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #7a8798;
    font-size: 12px;
}

.price-source-note a {
    color: #1f776b;
    font-weight: 800;
    text-decoration: none;
}

.price-history-note {
    color: #7a8798;
    font-size: 12px;
    line-height: 1.5;
    padding: 8px 10px;
    border-radius: 6px;
    background: #f7f9fb;
}

.price-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.price-card {
    display: grid;
    gap: 6px;
    min-height: 104px;
    padding: 12px;
    border: 1px solid #e1e7ef;
    border-radius: 8px;
    background: #fbfcfd;
}

.price-card__name {
    color: #172033;
    font-weight: 800;
    font-size: 13px;
}

.price-card__value {
    font-size: 22px;
    font-weight: 820;
    color: #172033;
}

.price-card__unit,
.price-card__meta {
    color: #667386;
    font-size: 12px;
}

.mini-trend {
    width: 100%;
    height: 42px;
}

.mini-trend path {
    fill: none;
    stroke: #1f776b;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mini-trend .trend-area {
    fill: rgba(31, 119, 107, 0.12);
    stroke: none;
}

.chain-panel,
.chain-main {
    background: #fff;
    border: 1px solid #dde4ec;
    border-radius: 8px;
}

.chain-panel {
    padding: 16px;
}

.chain-sidebar,
.chain-news {
    display: grid;
    gap: 16px;
}

.panel-heading,
.chain-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.panel-heading {
    margin-bottom: 14px;
    color: #172033;
    font-weight: 800;
}

.panel-heading i {
    color: #288c7a;
}

.segment-list,
.risk-list,
.news-list {
    display: grid;
    gap: 10px;
}

.segment-item {
    width: 100%;
    display: grid;
    gap: 8px;
    padding: 12px;
    text-align: left;
    border: 1px solid #e1e7ef;
    border-radius: 8px;
    background: #fbfcfd;
    cursor: pointer;
}

.segment-item.active {
    border-color: #2b927f;
    background: #edf9f6;
}

.segment-item__top,
.risk-item__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.segment-item__name {
    font-weight: 800;
    color: #172033;
}

.segment-item__meta,
.segment-item__focus,
.risk-item__message,
.news-item__summary {
    color: #667386;
    font-size: 12px;
}

.chain-main {
    min-width: 0;
}

.chain-toolbar {
    padding: 18px 18px 14px;
    border-bottom: 1px solid #e1e7ef;
}

.chain-toolbar h2 {
    margin: 2px 0 0;
    font-size: 22px;
}

.toolbar-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    border: 1px solid #d8e0e9;
    border-radius: 8px;
    background: #f7f9fb;
}

.segmented-button {
    height: 32px;
    padding: 0 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #5d6b7c;
    cursor: pointer;
    font-weight: 700;
}

.segmented-button.active {
    color: #fff;
    background: #1f776b;
}

.chain-table-wrap {
    overflow-x: auto;
}

.chain-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}

.chain-table th,
.chain-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #edf1f5;
    text-align: left;
    white-space: nowrap;
}

.chain-table th {
    color: #667386;
    font-size: 12px;
    font-weight: 800;
    background: #fafbfc;
}

.company-cell {
    display: grid;
    gap: 2px;
}

.company-cell a {
    color: #172033;
    font-weight: 800;
    text-decoration: none;
}

.company-cell span {
    color: #7a8798;
    font-size: 12px;
}

.metric-up {
    color: #0b8f62;
    font-weight: 800;
}

.metric-down {
    color: #c93d3d;
    font-weight: 800;
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 760;
    background: #eef2f6;
    color: #526173;
}

.risk-item {
    padding: 12px;
    border-left: 4px solid #aab5c2;
    background: #fbfcfd;
    border-radius: 6px;
}

.risk-item.high {
    border-left-color: #c93d3d;
    background: #fff6f5;
}

.risk-item.medium {
    border-left-color: #d89614;
    background: #fffaf0;
}

.risk-item.low {
    border-left-color: #5d8ec5;
}

.risk-item__title {
    font-weight: 800;
    color: #172033;
}

.news-item {
    padding-bottom: 12px;
    border-bottom: 1px solid #edf1f5;
}

.news-item a {
    color: #172033;
    font-weight: 800;
    text-decoration: none;
}

.news-item a:hover,
.company-cell a:hover {
    color: #1f776b;
}

.news-item__meta {
    margin: 4px 0;
    color: #7a8798;
    font-size: 12px;
}

.table-empty,
.panel-empty {
    padding: 24px;
    color: #7a8798;
    text-align: center;
}

.skeleton {
    background: linear-gradient(90deg, #eef2f6, #f8fafc, #eef2f6);
    background-size: 220% 100%;
    animation: chainShimmer 1.2s infinite linear;
}

@keyframes chainShimmer {
    to {
        background-position: -220% 0;
    }
}

@media (max-width: 1280px) {
    .chain-workbench {
        grid-template-columns: 290px minmax(0, 1fr);
    }

    .chain-news {
        grid-column: 1 / -1;
    }
}

@media (max-width: 860px) {
    .ai-chain-shell {
        padding: 14px;
    }

    .ai-chain-hero {
        min-height: 320px;
        flex-direction: column;
        padding: 24px;
    }

    .chain-kpi-grid,
    .price-trend-grid,
    .chain-workbench {
        grid-template-columns: 1fr;
    }

    .chain-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .price-card-grid {
        grid-template-columns: 1fr;
    }
}
