.br-grid-wrapper {
    padding: 6px 0;
}

.br-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 18px;
    align-items: start;
}

.br-book-card {
    background: #fff;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 3px 12px rgba(0,0,0,0.06);
    transition: transform .12s ease, box-shadow .12s ease;
}

.br-book-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 26px rgba(0,0,0,0.12);
}

.br-thumb-wrap { 
    overflow: hidden;
    border-radius: 8px;
}

.br-thumb {
    width: 100%;
    height: auto;
    display: block;
}

.br-title {
    font-size: 15px;
    margin: 8px 0 0 0;
    line-height: 1.25;
}

.br-title a { color: inherit; text-decoration: none; }

@media (min-width: 900px) {
    .br-grid { gap: 22px; }
}

.br-explanation {
    margin-top: 8px;
    text-align: left;
    font-size: 12px;
    color: #555;
}
.br-explanation .br-method {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}
.br-explain-row { margin: 2px 0; }

/* Preference card */
.br-pref-card {
    background: #fff;
    padding: 12px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.06);
    margin-bottom: 12px;
}
.br-pref-card h4 { margin: 0 0 8px 0; font-size: 15px }
.br-pref-section { margin-bottom: 8px; font-size: 13px }
.br-pref-row { display:flex; align-items:center; gap:8px; margin:6px 0 }
.br-pref-name { flex: 0 0 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.br-pref-bar { flex: 1 1 auto; background:#eee; height:10px; border-radius:6px; overflow:hidden; }
.br-pref-bar span { display:block; height:100%; background:linear-gradient(90deg,#4caf50,#2e7d32); }
.br-pref-count { flex: 0 0 36px; text-align:right; color:#333; font-weight:600 }

@media (max-width:600px) {
    .br-pref-name { flex-basis: 35% }
}

/* Heatmap table */
.br-heatmap { margin: 12px 0; background: #fff; padding:10px; border-radius:8px; box-shadow:0 3px 8px rgba(0,0,0,0.05) }
.br-heatmap h4 { margin: 0 0 8px 0; font-size:14px }
.br-heatmap-wrap { overflow:auto }
.br-heatmap-table { border-collapse: collapse; width:100%; font-size:12px }
.br-heatmap-table th, .br-heatmap-table td { border:1px solid #f1f1f1; padding:6px; text-align:center }
.br-heatmap-table thead th { background:#fafafa; position:sticky; top:0 }
.br-heatmap-table th:first-child, .br-heatmap-table td:first-child { text-align:left; font-weight:600 }
.br-heatmap-legend { margin-top:6px; font-size:12px; color:#555 }
