/* Kärnkraft Sverige Anläggningar v2.1 */
#kk-app {
    background: #0a0f1a;
    border-radius: 12px;
    padding: 28px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #e2e8f0;
}
/* KPI row */
#kk-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.kk-kpi {
    background: #111827;
    border: 1px solid #1e293b;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}
.kk-kpi-val { display: block; font-size: 1.6em; font-weight: 800; color: #38bdf8; }
.kk-kpi-lbl { display: block; font-size: 0.72em; color: #64748b; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }
/* Filters */
#kk-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.kk-filter {
    background: #111827;
    border: 1px solid #1e293b;
    color: #94a3b8;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}
.kk-filter:hover { border-color: #3b82f6; color: #e2e8f0; }
.kk-filter.active { background: #1e40af; border-color: #3b82f6; color: #fff; }
/* Card grid */
#kk-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.kk-card {
    background: #111827;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 22px;
    transition: border-color 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}
.kk-card:hover {
    border-color: var(--accent, #3b82f6);
    transform: translateY(-2px);
}
.kk-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}
.kk-card-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.7em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.kk-card-icon { font-size: 1.5em; }
.kk-card-title {
    font-size: 1.1em;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 4px;
    line-height: 1.3;
}
.kk-card-location {
    font-size: 0.78em;
    color: #64748b;
    margin-bottom: 12px;
}
/* MW display */
.kk-card-mw {
    margin-bottom: 6px;
}
.kk-mw-num { font-size: 1.8em; font-weight: 800; color: #38bdf8; }
.kk-mw-unit { font-size: 0.9em; color: #64748b; font-weight: 600; }
.kk-card-mw-bar {
    height: 5px;
    background: #1e293b;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}
.kk-card-mw-fill { height: 100%; border-radius: 3px; transition: width 0.6s; }
/* Reactor chips */
.kk-card-reactors {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.kk-reactor-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78em;
    font-weight: 600;
}
.kk-reactor-chip small { font-weight: 400; opacity: 0.7; }
.kk-chip-on { background: rgba(34,197,94,0.12); color: #22c55e; }
.kk-chip-off { background: rgba(239,68,68,0.12); color: #ef4444; }
/* Description */
.kk-card-desc {
    font-size: 0.82em;
    color: #94a3b8;
    line-height: 1.5;
    margin-bottom: 14px;
    flex: 1;
}
.kk-card-btn {
    display: block;
    width: 100%;
    background: #1e293b;
    border: 1px solid #334155;
    color: #94a3b8;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.kk-card-btn:hover { background: #334155; color: #fff; border-color: var(--accent, #3b82f6); }
/* Detail overlay */
#kk-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
#kk-detail-panel {
    background: #111827;
    border: 1px solid #1e293b;
    border-radius: 14px;
    max-width: 680px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    color: #e2e8f0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
#kk-detail-panel::-webkit-scrollbar { width: 6px; }
#kk-detail-panel::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
#kk-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #1e293b;
    border: 1px solid #334155;
    color: #94a3b8;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 1.3em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
#kk-close-btn:hover { background: #334155; color: #fff; }
.kk-detail-badge-row { margin-bottom: 8px; }
.kk-detail-badge { display: inline-block; padding: 4px 12px; border-radius: 8px; font-size: 0.72em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
#kk-detail-panel h2 { font-size: 1.4em; font-weight: 800; margin: 0 0 8px; color: #f1f5f9; }
#kk-detail-panel h3 { font-size: 1em; color: #94a3b8; margin: 20px 0 10px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.kk-detail-meta { font-size: 0.85em; color: #64748b; line-height: 1.6; margin-bottom: 12px; }
.kk-detail-desc { font-size: 0.92em; color: #cbd5e1; line-height: 1.65; padding: 14px; background: #1e293b; border-radius: 10px; border-left: 3px solid #3b82f6; margin-bottom: 8px; }
/* Table */
.kk-table { width: 100%; border-collapse: collapse; font-size: 0.85em; }
.kk-table th { text-align: left; color: #64748b; font-weight: 600; text-transform: uppercase; font-size: 0.82em; padding: 10px 8px; border-bottom: 1px solid #1e293b; }
.kk-table td { padding: 10px 8px; border-bottom: 1px solid rgba(30,41,59,0.5); color: #e2e8f0; }
.kk-table tr:last-child td { border-bottom: none; }
.kk-on { color: #22c55e; font-weight: 700; }
.kk-off { color: #ef4444; font-weight: 700; }
/* MW box */
.kk-mw-box { background: #1e293b; border-radius: 10px; padding: 14px; margin: 12px 0; }
.kk-mw-box-label { font-size: 0.72em; color: #64748b; text-transform: uppercase; margin-bottom: 6px; }
.kk-mw-box-bar { height: 8px; background: #0f172a; border-radius: 4px; overflow: hidden; }
.kk-mw-box-fill { height: 100%; border-radius: 4px; }
.kk-mw-box-val { font-size: 1.3em; font-weight: 800; color: #38bdf8; margin-top: 6px; }
/* Facts */
.kk-facts { list-style: none; padding: 0; margin: 0; }
.kk-facts li { padding: 6px 0 6px 22px; position: relative; font-size: 0.88em; color: #94a3b8; line-height: 1.5; }
.kk-facts li::before { content: '\26A1'; position: absolute; left: 0; top: 6px; font-size: 0.8em; }
/* Responsive */
@media (max-width: 768px) {
    #kk-app { padding: 16px; }
    #kk-kpi-row { grid-template-columns: 1fr 1fr; }
    #kk-cards { grid-template-columns: 1fr; }
    #kk-detail-panel { padding: 20px; }
}
