:root {
    --bg: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #1c2128;
    --border: #30363d;
    --text: #c9d1d9;
    --text-muted: #8b949e;
    --accent: #58a6ff;
    --green: #3fb950;
    --red: #f85149;
    --yellow: #d29922;
    --orange: #db6d28;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    padding: 16px;
    max-width: 960px;
    margin: 0 auto;
}

.hidden { display: none !important; }

/* Header */
.header { text-align: center; margin-bottom: 16px; }
.header h1 { font-size: 18px; color: var(--accent); font-weight: 600; }
.check-id { font-family: monospace; color: var(--text-muted); font-size: 12px; }

/* Progress Bar */
.loading { padding: 40px 0; }
.progress-container { max-width: 400px; margin: 0 auto; }
.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-muted);
}
#progress-pct { color: var(--accent); font-weight: 600; font-family: monospace; }
.progress-track {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 6px;
    margin-bottom: 12px;
}
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 8px;
    text-align: center;
}
.card .label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.card .value { font-size: 13px; font-weight: 600; margin-top: 3px; word-break: break-all; }
.card .value.yes { color: var(--green); }
.card .value.no { color: var(--red); }
.card .value.warn { color: var(--yellow); }

/* Tabs */
.tab-bar {
    display: flex;
    gap: 1px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.tab {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 7px 14px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px;
    min-height: 180px;
    overflow-x: auto;
}

/* Actions */
.actions { display: flex; gap: 8px; margin-top: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
    background: var(--bg-secondary);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 7px 14px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm {
    background: var(--bg-tertiary);
    color: var(--accent);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 3px 10px;
    cursor: pointer;
    font-size: 11px;
    margin-left: 6px;
    transition: all 0.15s;
}
.btn-sm:hover { background: var(--accent); color: var(--bg); }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td {
    padding: 5px 8px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 12px;
}
th { color: var(--text-muted); font-weight: 500; width: 30%; }
td { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; font-size: 11px; word-break: break-all; }
.td-detail { font-size: 11px; color: var(--text-muted); }

pre {
    background: var(--bg);
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 11px;
    white-space: pre-wrap;
    word-break: break-all;
}

/* JA3 Section */
.ja3-section { margin-bottom: 16px; }
.fp-row {
    display: flex;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 4px;
}
.fp-label { color: var(--text-muted); font-size: 12px; min-width: 100px; }
.fp-value {
    font-family: monospace;
    font-size: 12px;
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 3px;
    word-break: break-all;
    flex: 1;
}
.fp-mono { font-size: 10px; }

/* JA3 Detail Modal */
.ja3-modal {
    background: var(--bg-tertiary);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
    max-height: 70vh;
    overflow-y: auto;
}
.ja3-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.ja3-modal h3 { color: var(--accent); font-size: 14px; }
.ja3-modal h4 { color: var(--text-muted); font-size: 12px; margin-top: 8px; margin-bottom: 4px; }
.fp-list { display: flex; flex-direction: column; gap: 1px; }
.fp-item {
    font-family: monospace;
    font-size: 11px;
    padding: 2px 6px;
    background: var(--bg);
    border-radius: 2px;
}
.fp-hex { color: var(--text-muted); margin-right: 8px; }

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--accent);
    color: var(--bg);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    z-index: 1000;
    animation: fadeInOut 2s ease;
}
@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(10px); }
    15% { opacity: 1; transform: translateY(0); }
    85% { opacity: 1; }
    100% { opacity: 0; }
}

/* Responsive */
@media (max-width: 600px) {
    body { padding: 10px; }
    .summary-cards { grid-template-columns: repeat(2, 1fr); }
    .tab { padding: 6px 10px; font-size: 11px; }
    .fp-row { flex-direction: column; align-items: flex-start; }
}
