* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    color: #222;
    background: #f4f5f7;
    display: flex;
    flex-direction: column;
}

.toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid #ddd;
}
.upload { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.upload input { font-weight: normal; }
#compare-btn {
    padding: 6px 18px;
    border: 0;
    border-radius: 4px;
    background: #1565c0;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}
#compare-btn:disabled { background: #9e9e9e; cursor: default; }
.status-text { color: #555; }
.muted { color: #777; font-weight: normal; }

.panels {
    display: flex;
    gap: 8px;
    padding: 8px;
    flex: 1 1 60%;
    min-height: 300px;
}
.panel {
    flex: 1 1 50%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.panel-title {
    padding: 6px 10px;
    font-weight: 600;
    border-bottom: 1px solid #ddd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.panel iframe { flex: 1; width: 100%; border: 0; }

.results {
    flex: 1 1 40%;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    margin: 0 8px 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.results-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 10px;
    border-bottom: 1px solid #ddd;
}
.summary span { margin-right: 14px; }
.filters { display: flex; align-items: center; gap: 16px; }
.kind-filter { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.summary b { font-size: 14px; }
.table-wrap { flex: 1; overflow: auto; }
#results-table { width: 100%; border-collapse: collapse; }
#results-table th {
    position: sticky;
    top: 0;
    background: #fafafa;
    text-align: left;
    padding: 5px 8px;
    border-bottom: 1px solid #ddd;
}
#results-table td { padding: 4px 8px; border-bottom: 1px solid #eee; vertical-align: top; }
#results-table tbody tr { cursor: pointer; }
#results-table tbody tr:hover { background: #f0f6ff; }
#results-table tbody tr.selected { background: #dbe9ff; }
#results-table td.text-cell { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#results-table .matched { font-weight: 700; color: #1b5e20; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; white-space: nowrap; }
.badge.rank1 { background: #c8e6c9; color: #1b5e20; }
.badge.top5 { background: #e6f4d7; color: #33691e; }
.badge.notTop5 { background: #ffcdd2; color: #b71c1c; }
.badge.extra, .badge.missing { background: #ffe0b2; color: #e65100; }
