/* Home library controls: one calm toolbar instead of three colored boxes.
   Same palette/shapes as the For You view (discover.css). */
.hm {
    --hm-panel: #232428;
    --hm-raised: #3a3c43;
    --hm-line: rgba(255, 255, 255, 0.08);
    --hm-text: #ececf1;
    --hm-muted: #a3a6b0;
    --hm-pink: #f786f4;
}
.hm-icon { width: 15px; height: 15px; flex-shrink: 0; }

.hm-tabs { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 18px; background: var(--hm-panel); border: 1px solid var(--hm-line); border-radius: 12px; }
.hm-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 9px; color: var(--hm-muted); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
.hm-tabs a[aria-current="page"] { background: var(--hm-raised); color: #fff; }
.hm-tabs a:hover { color: #fff; }

.hm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.hm-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; margin: 0; font-size: 22px; line-height: 1.2; }
.hm-title-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-count { color: var(--hm-muted); font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.hm-new { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; padding: 8px 14px; border-radius: 10px; background: var(--hm-pink); color: #2a0b2b; font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.hm-new:hover { filter: brightness(1.08); }

.hm-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.hm-seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--hm-panel); border: 1px solid var(--hm-line); border-radius: 12px; }
.hm-seg button { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--hm-muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.hm-seg button:hover { color: #fff; }
.hm-seg button[aria-pressed="true"] { background: var(--hm-raised); color: #fff; }
.hm-seg button[aria-pressed="true"] .hm-heart { color: var(--hm-pink); }
.hm-seg-n { color: var(--hm-muted); font-size: 12.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.hm-seg-n:empty { display: none; }

.hm-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.hm-sort, .hm-switch { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 12px; background: var(--hm-panel); border: 1px solid var(--hm-line); border-radius: 999px; color: var(--hm-muted); font-size: 13.5px; font-weight: 600; }
.hm-sort { position: relative; padding-right: 30px; }
.hm-sort:focus-within, .hm-switch:focus-visible { border-color: rgba(247, 134, 244, 0.6); }
/* Native select keeps the phone picker; only its box is restyled (WebKit
   painted it white with white text). */
.hm-sort select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: var(--hm-text); font: inherit; padding: 0; margin: 0; cursor: pointer; outline: none; }
.hm-sort select option { background: #232428; color: #ececf1; }
.hm-sort::after { content: ''; position: absolute; right: 13px; top: 50%; width: 6px; height: 6px; margin-top: -5px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); pointer-events: none; }
.hm-switch { border-style: solid; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600; }
.hm-switch:hover { color: #fff; }
.hm-switch-track { position: relative; width: 30px; height: 18px; border-radius: 999px; background: #4a4c55; transition: background 0.15s; }
.hm-switch-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #d7d8de; transition: transform 0.15s; }
.hm-switch[aria-checked="true"] { color: var(--hm-text); }
.hm-switch[aria-checked="true"] .hm-switch-track { background: var(--hm-pink); }
.hm-switch[aria-checked="true"] .hm-switch-track::after { transform: translateX(12px); background: #fff; }

.hm-chips { display: flex; gap: 6px; margin: 0 0 16px; padding-bottom: 4px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.hm-chips::-webkit-scrollbar { display: none; }
.hm-chips button { flex-shrink: 0; padding: 6px 12px; border: 1px solid var(--hm-line); border-radius: 999px; background: transparent; color: var(--hm-muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.hm-chips button:hover { color: #fff; border-color: rgba(255, 255, 255, 0.18); }
.hm-chips button.active { background: #ececf1; border-color: #ececf1; color: #1b1c20; }

@media (max-width: 768px) {
    .hm-tabs { display: flex; width: 100%; }
    .hm-tabs a { flex: 1; justify-content: center; }
    .hm-title { font-size: 20px; }
    .hm-toolbar { gap: 8px; }
    .hm-seg { flex: 1 1 auto; }
    .hm-seg button { flex: 1; justify-content: center; }
    .hm-tools { margin-left: 0; flex: 1 1 100%; }
    .hm-sort { flex: 1; }
    .hm-sort select { width: 100%; }
}
@media (max-width: 360px) {
    .hm-seg button { padding: 0 9px; font-size: 13px; }
    .hm-new { padding: 8px 11px; }
}

/* Guests: a tab/switch with a single option is just noise. */
.hm-tabs:not(:has(#discoverLink:not(.hidden))),
.hm-seg:not(:has(#btnMyFavs:not(.hidden))) { display: none; }
