* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #fafafa;
    color: #222;
    font-size: 13px;
    height: 100vh;
    overflow: hidden;
}

.header {
    padding: 14px 0 10px;
    border-bottom: 1px solid #ddd;
    background: #fff;
}

.header select {
    font-size: 14px;
    padding: 6px 12px;
    border: 1px solid #bbb;
    border-radius: 4px;
    background: #fff;
}

.hf-btn {
    font-size: 14px;
    padding: 6px 12px;
    border: 1px solid #bbb;
    border-radius: 4px;
    background: #fff;
    text-decoration: none;
    color: #222;
    display: none;
}

.hf-btn:hover {
    background: #f0f0f0;
}

.diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 24px 12px;
    height: calc(100vh - 50px);
    overflow-y: auto;
}

/* Nodes */
.node {
    border: 1.5px solid #ccc;
    border-radius: 6px;
    padding: 10px 14px;
    background: #fff;
    width: 520px;
}

.node-title {
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #eee;
    color: #444;
}

.node.dimmed {
    opacity: 0.35;
}

/* Two-col layout inside nodes */
.two-col {
    display: flex;
    gap: 20px;
}

.two-col>div {
    flex: 1;
}

.col-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #999;
    margin-bottom: 3px;
}

/* Key-value */
.kv {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2px 0;
}

.kv .k {
    color: #777;
    font-size: 12px;
}

.kv .v {
    font-weight: 600;
}

/* Connector arrows with decision labels */
.connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 2px 0;
    width: 520px;
}

.connector-line {
    width: 1.5px;
    height: 12px;
    background: #bbb;
}

.connector-label {
    font-size: 11px;
    color: #666;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 2px 10px;
    margin: 2px 0;
    white-space: nowrap;
}

.connector-label.decision {
    background: #fff8e1;
    border-color: #ffe082;
    color: #8d6e00;
}

.connector-label.llm-call {
    background: #f3e5f5;
    border-color: #ce93d8;
    color: #6a1b9a;
}

.connector-label.skip {
    background: #ffebee;
    border-color: #ef9a9a;
    color: #b71c1c;
}

.connector-label.win {
    background: #e8f5e9;
    border-color: #a5d6a7;
    color: #2e7d32;
}

.connector-arrow {
    font-size: 14px;
    color: #bbb;
    line-height: 1;
}

/* Confidence bar */
.conf-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 1px 0;
}

.conf-track {
    flex: 1;
    height: 7px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.conf-fill {
    height: 100%;
    border-radius: 3px;
}

.conf-pct {
    font-size: 11px;
    color: #888;
    min-width: 30px;
    text-align: right;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.badge-modelcard {
    background: #fff3cd;
    color: #856404;
}

.badge-github_code {
    background: #cce5ff;
    color: #004085;
}

.badge-heuristic {
    background: #d4edda;
    color: #155724;
}

.badge-llm,
.badge-llm_chip {
    background: #f3e5f5;
    color: #6a1b9a;
}

.badge-arxiv_paper {
    background: #fff0e6;
    color: #bf360c;
}

.badge-base_model {
    background: #e8eaf6;
    color: #283593;
}

.badge-framework_default_derivative {
    background: #fce4ec;
    color: #880e4f;
}

.badge-unknown {
    background: #eee;
    color: #888;
}

/* Chip / framework value colors */
.val-nvidia {
    color: #2e7d32;
}

.val-google_tpu {
    color: #1565c0;
}

.val-intel {
    color: #00838f;
}

.val-amd {
    color: #c62828;
}

.val-apple {
    color: #555;
}

.val-aws {
    color: #ef6c00;
}

.val-qualcomm {
    color: #5e35b1;
}

.val-huawei_ascend {
    color: #b71c1c;
}

.val-cambricon {
    color: #6a1b9a;
}

.val-baidu_kunlun {
    color: #0277bd;
}

.val-moore_threads {
    color: #ad1457;
}

.val-iluvatar {
    color: #4527a0;
}

.val-hygon {
    color: #00695c;
}

.val-metax {
    color: #4a148c;
}

.val-mindspore {
    color: #b71c1c;
}

.val-unknown {
    color: #aaa;
}

.val-pytorch {
    color: #e65100;
}

.val-tensorflow {
    color: #1565c0;
}

.val-jax {
    color: #6a1b9a;
}

.val-onnx {
    color: #00838f;
}

.val-mxnet {
    color: #c62828;
}

.val-paddlepaddle {
    color: #0d47a1;
}

/* Bar fill colors */
.fill-nvidia {
    background: #4caf50;
}

.fill-google_tpu {
    background: #42a5f5;
}

.fill-intel {
    background: #26c6da;
}

.fill-amd {
    background: #ef5350;
}

.fill-apple {
    background: #9e9e9e;
}

.fill-aws {
    background: #ff9800;
}

.fill-qualcomm {
    background: #7e57c2;
}

.fill-huawei_ascend {
    background: #e53935;
}

.fill-cambricon {
    background: #ab47bc;
}

.fill-baidu_kunlun {
    background: #29b6f6;
}

.fill-moore_threads {
    background: #ec407a;
}

.fill-iluvatar {
    background: #7e57c2;
}

.fill-hygon {
    background: #26a69a;
}

.fill-metax {
    background: #8e24aa;
}

.fill-mindspore {
    background: #e53935;
}

.fill-unknown {
    background: #d0d0d0;
}

.fill-pytorch {
    background: #ff9800;
}

.fill-tensorflow {
    background: #42a5f5;
}

.fill-jax {
    background: #ab47bc;
}

.fill-onnx {
    background: #26c6da;
}

.fill-mxnet {
    background: #ef5350;
}

.fill-paddlepaddle {
    background: #1976d2;
}

/* Link list */
.link-list {
    font-size: 11px;
    margin: 3px 0;
}

.link-item {
    margin: 1px 0;
}

.link-item a {
    color: #1565c0;
    text-decoration: none;
    word-break: break-all;
}

.link-item a:hover {
    text-decoration: underline;
}

.link-item.selected {
    font-weight: 600;
}

.link-item.rejected,
.link-item.rejected a {
    color: #aaa;
}

/* Toggle button for link list */
.toggle-links-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
    margin-top: 4px;
}

.toggle-links-btn:hover {
    color: #222;
}

.toggle-links-btn svg {
    width: 12px;
    height: 12px;
    transition: transform 0.2s;
}

.toggle-links-btn.expanded svg {
    transform: rotate(180deg);
}

/* Conclusion */
.node-conclusion {
    transform: scale(1.05);
    margin: 15px 0 25px 0;
    border-color: #bbb;
    border-width: 2px;
}

.conclusion-row {
    display: flex;
    gap: 14px;
}

.conclusion-dim {
    flex: 1;
    padding: 6px 10px;
    border-left: 3px solid #ccc;
    border-radius: 0 4px 4px 0;
}

.conclusion-dim.src-modelcard {
    border-left-color: #ffc107;
    background: #fffdf0;
}

.conclusion-dim.src-github_code {
    border-left-color: #42a5f5;
    background: #f5faff;
}

.conclusion-dim.src-arxiv_paper {
    border-left-color: #ff7043;
    background: #fff8f5;
}

.conclusion-val {
    font-size: 16px;
    font-weight: 700;
    margin: 2px 0;
}

/* Section pills */
.pills {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 3px;
}

.pill {
    font-size: 10px;
    padding: 1px 5px;
    background: #f0f0f0;
    border-radius: 3px;
    color: #666;
}

/* Detection files */
.det-files code {
    background: #f5f5f5;
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 10px;
    color: #555;
}

.empty {
    color: #999;
    font-style: italic;
    text-align: center;
    margin-top: 60px;
}