.ha-section{
 --ha-edge:#a58aff;--ha-surface:#201b29;--ha-ink:#faf4ff;--ha-muted:#d0c5da;
 margin-block:18px;padding:clamp(14px,2vw,26px);border:1px solid #a58aff48;border-radius:16px;
 background:#18151c;color:var(--ha-ink);min-width:0
}
.ha-section[data-ha-kind=voice]{--ha-edge:#86d4dc;--ha-surface:#142528;--ha-muted:#c4dadd;background:#131f22;border-color:#86d4dc48}
.ha-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:14px}
.ha-section .ha-heading h2{margin:0;font-size:clamp(20px,2.2vw,28px);line-height:1.2;letter-spacing:-.025em;color:var(--ha-ink)}
.ha-heading>div,.ha-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.ha-section :is(a,button){font:inherit}
.ha-section .ha-heading .button,.ha-section button{
 display:inline-flex;align-items:center;justify-content:center;min-height:42px;
 padding:6px 12px;border:1px solid #ffffff3a;border-radius:9px;background:#ffffff0b;
 color:var(--ha-ink);cursor:pointer;text-decoration:none;font-size:.875rem;font-weight:700
}
.ha-section .ha-heading .button:hover,.ha-section button:hover{border-color:var(--ha-edge)}
.ha-section .ha-play[aria-pressed=true]{border-color:var(--ha-edge);background:var(--ha-edge);color:#16121c}
.ha-section :is(button,a,summary,.ha-rail):focus-visible{outline:2px solid var(--ha-edge);outline-offset:2px}
.ha-rail{
 display:grid;grid-auto-flow:column;grid-auto-columns:minmax(min(80%,230px),29%);align-items:start;gap:10px;
 padding:3px 3px 10px;overflow-x:auto;overscroll-behavior-inline:contain;
 scroll-snap-type:x proximity;scrollbar-width:thin;scrollbar-color:#ffffff47 transparent
}
.ha-card{scroll-snap-align:start;min-width:0;border-radius:12px;padding:14px;background:var(--ha-surface);overflow-wrap:anywhere}
.ha-card h3{margin:0 0 4px;font-size:1.045rem;line-height:1.35;color:var(--ha-ink)}
.ha-genre,.ha-empty{color:var(--ha-muted);margin:0 0 12px}
.ha-empty{margin:0;font-size:.9rem}
.ha-card details{margin-top:12px}
.ha-card summary{width:fit-content;color:var(--ha-edge);cursor:pointer;font-size:.875rem;min-height:36px;align-content:center}
.ha-details{padding-block:9px 0;border-top:1px solid #ffffff28}
.ha-details dl{margin:0}
.ha-details dt{font-weight:700}
.ha-details dd{margin:0 0 10px;white-space:pre-wrap}
.ha-transcript{white-space:pre-wrap;max-height:13rem;overflow:auto;margin:0 0 12px;color:var(--ha-muted);font-size:.9rem;line-height:1.55}
.ha-player[hidden]{display:none}
.ha-player{display:grid;grid-template-columns:minmax(0,1fr) minmax(180px,340px);align-items:center;gap:10px;margin-top:9px}
.ha-player p{margin:0;overflow-wrap:anywhere}
.ha-player audio{display:block;width:100%;max-width:100%;height:40px}
@media(max-width:600px){
 .ha-rail{grid-auto-columns:min(82%,270px)}
 .ha-player{grid-template-columns:minmax(0,1fr)}
 .ha-section :is(.ha-heading .button,button){min-height:44px}
}

/* Keep the trend heading and its controls inside both shelves on phones. */
@media(max-width:700px){
 body[data-page=home] .top-preset-section .section-head{flex-wrap:wrap;align-items:flex-start;gap:8px}
 body[data-page=home] .top-preset-section .rail-actions{flex-wrap:wrap;max-width:100%;min-width:0}
 body[data-page=home] .top-preset-section .rail-actions a{white-space:normal}
}

.ha-section [id$="-title"]{scroll-margin-top:90px}
@media(min-width:900px){
 .ha-rail:has(>.ha-card:nth-child(2):last-child){grid-auto-columns:calc((100% - 10px)/2)}
 .ha-rail:has(>.ha-card:only-child){grid-auto-columns:min(52%,480px)}
}
