/* Keep directory cards equally tall and in category order. */
.category-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:20px}
/* Fade the directory once without delaying interaction or image loading. */
@media(prefers-reduced-motion:no-preference){
#content-multi{animation:directory-reveal .18s ease-out}
}
@keyframes directory-reveal{from{opacity:0}to{opacity:1}}
.directory-section{--category-color:#eb688a;min-width:0;border-radius:15px;background:white;overflow:hidden;display:flex;flex-direction:column}
/* Fixed card heights let offscreen categories skip rendering without moving the page. */
.category-grid>.directory-section{height:620px;content-visibility:auto}
.category-grid>.directory-section:nth-child(2){--category-color:#cba74c}
.category-grid>.directory-section:nth-child(3){--category-color:#50b7b0}
.category-grid>.directory-section:nth-child(4){--category-color:#eb7f71}
.category-grid>.directory-section:nth-child(5){--category-color:#7a83d5}
.category-grid>.directory-section:nth-child(6){--category-color:#5e9ba7}
.directory-section:nth-child(7n){--category-color:#d773d2}
.directory-section:nth-child(7n + 8){--category-color:#d38f61}
.directory-section:nth-child(7n + 9){--category-color:#60ad81}
.directory-section:nth-child(7n + 10){--category-color:#3aa9cb}
.directory-section:nth-child(7n + 11){--category-color:#9f7c72}
.directory-section:nth-child(7n + 12){--category-color:#7b9f7a}
.section-title{background:var(--category-color);padding:6px 10px;color:white;flex-shrink:0}
.title-text{font-size:14px;line-height:24px;margin:0;font-weight:700}
.title-text a{display:flex;align-items:center;justify-content:space-between;gap:8px;color:inherit}
.title-text .icon-hand-pointer{flex-shrink:0}
/* Paint the scrolling surface itself, not only its parent card. */
.directory-section>.section-list{padding:6px 8px;flex:1;min-height:0;overflow:auto;background:inherit;scrollbar-width:thin;scrollbar-color:#dedede white}
.section-footer{padding:15px 25px;background:#fff;box-shadow:0 -4px 20px #2c6f8412;flex-shrink:0}
.section-footer:empty{display:none}
.section-viewall{display:block;background:#eee;border:1px solid #e3e3e3;border-radius:10px;color:#5f5a5b;text-align:center;font-size:14px;line-height:28px;padding:0 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.section-viewall:hover{background:white;text-decoration:none}
.section-viewall+.section-viewall{margin-top:4px}
.section-viewall.section-errors{border:0;background:transparent;color:#b34552;line-height:24px}
.section-item{border-bottom:1px solid #ccd5d9;position:relative;min-width:0}
.site-row-head{display:flex;align-items:center;gap:5px;min-height:29px;padding:2px 4px;position:relative}
.site-row-head:hover{background:#f8f8f8}
.row-rank{width:22px;height:22px;display:grid;place-items:center;flex-shrink:0;border-radius:50%;background:#e1e1e1;color:#fff;font-size:14px}
.site-row-title{min-width:0;flex:1;display:flex;align-items:center;gap:3px}
.site-link{color:#111;display:flex;align-items:center;gap:6px;font-size:14px;font-weight:500;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.site-logo{width:16px;height:16px;object-fit:contain;flex-shrink:0}
.site-row-actions{display:flex;gap:3px;align-items:center;flex-shrink:0}
.visited-mark{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:20px;height:24px;color:#b5bcc0}
.bookmark-btn{background:transparent;border:0;padding:1px 3px;color:#b9b9b9;line-height:26px;min-width:36px;min-height:32px;cursor:pointer}
.icon-star{width:26px;height:26px;fill:currentColor;stroke:none;flex-shrink:0}
.bookmarked{color:#ffb151}
.site-status{font-size:12px;white-space:nowrap;border-radius:3px;padding:1px 4px}
.tag-up{color:#238456;background:#e1f3e9}
.tag-down{color:#7b6c50;background:#f7f3e8}
.tag-error{color:#b34552;background:#ffe4e8}
/* Keep the full status on one line and truncate long names in the remaining space. */
.category-grid .site-row-head{display:grid;grid-template-columns:minmax(0,1fr) auto;align-content:start;gap:0 5px;min-height:56px;padding:2px 0 2px 27px}
.category-grid .row-rank{position:absolute;left:0;top:3px}
.category-grid .site-row-title{line-height:28px;overflow:hidden}
.category-grid .site-status{line-height:16px}
.category-grid .site-row-actions{position:absolute;right:0;bottom:2px}
.category-grid .bookmark-btn{display:inline-flex;align-items:center;justify-content:center;min-width:40px;min-height:32px;padding:0 4px;border:0;border-radius:4px;background:transparent;font-size:12px;text-decoration:none}
.category-grid .bookmark-btn:hover,.category-grid .bookmark-btn:focus-visible{background:#edf5f7}
.category-grid .site-link{display:block;flex:1;padding-left:90px;position:relative;font-size:16px}
.category-grid .site-logo,.category-grid .site-link>.inline-icon{position:absolute;left:0;top:50%;transform:translateY(-50%);width:84px;height:28px}
.full-section{background:#555;color:white}
.full-section>.section-list{padding:0;overflow:visible}
.section-meta{display:flex;padding:10px 20px;background:#404040;font-size:12px}
.sort-input{margin-left:auto;border:1px solid #777;border-radius:5px;padding:3px 5px;background:#555;color:#fff}
.site-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:10px;padding:20px}
.site-card{grid-column:span 3;background:#252525;color:white;border-radius:12px;overflow:hidden;border:0;display:flex;flex-direction:column}
.site-card:nth-child(-n+3){grid-column:span 4;margin-bottom:20px}
.site-card:nth-child(-n+3) .card-preview{aspect-ratio:2/1}
.card-preview{display:block;aspect-ratio:4/3;background:#20292d;overflow:hidden;position:relative}
.card-preview>img{width:100%;height:100%;object-fit:cover;display:block}
.card-preview>span{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:16px;width:100%;height:100%;background:#e2f0f4;color:#467b8d}
.card-preview>span .site-logo{width:100px;height:40px}
.card-preview>span b{font-size:22px}
.site-card .site-row-head{flex-wrap:wrap;background:#444;padding:8px 10px;gap:5px;min-height:38px}
.site-card .row-rank{background:transparent;width:20px;color:white;font-weight:700;border-radius:0}
.site-card .site-link{color:#fff;font-weight:700;flex:1;justify-content:center}
.site-card .site-status{order:4;flex-basis:calc(100% + 20px);font-size:13px;font-weight:700;line-height:28px;text-align:center;border-radius:0;margin:3px -10px -8px;padding:0 5px}
.site-card .site-row-actions{position:absolute;right:8px;bottom:calc(100% + 8px)}
.site-card .bookmark-btn{display:flex;align-items:center;justify-content:center;min-width:36px;min-height:36px;padding:0;border-radius:5px;background:#202020cc}
.site-card .site-row-title{justify-content:center}
.site-card .site-name{flex:1;text-align:center;overflow:hidden;text-overflow:ellipsis}
.site-card:nth-child(-n+3) .site-link{font-size:18px}
.full-section .section-footer{background:#444;box-shadow:none}
.full-section .section-viewall:not(.section-errors){background:#606060;color:white;border-color:#777}
.full-section .section-errors{width:220px;max-width:100%;margin:0 auto;padding:10px 16px;background:#d52d52;color:#fff;font-size:16px;font-weight:700;border-radius:8px}
.full-section .section-errors:hover{background:#b82244}
.search-summary{color:#476f7d}
@media(min-width:590px) and (max-width:1023px){
.category-grid{grid-template-columns:repeat(2,minmax(0,1fr));margin:0 30px;gap:20px 10px}
.category-grid>.directory-section{height:450px}
}
@media(max-width:767px){
.category-grid .site-row-head{min-height:72px}
.category-grid .bookmark-btn,.site-card .bookmark-btn{min-width:44px;min-height:44px}
.site-grid{grid-template-columns:repeat(2,minmax(0,1fr));padding:12px;gap:10px}
.site-card:nth-child(n){grid-column:span 1;margin:0}
.site-card:nth-child(-n+3){grid-column:1/-1}
.site-card .site-row-head{padding:7px;gap:4px}
.site-card .site-row-title{flex-basis:calc(100% - 30px)}
.site-card .site-status{flex-basis:calc(100% + 14px);margin:3px -7px -7px;order:4;font-size:12px}
.section-meta{padding:10px 15px}
.sort-input{min-height:44px}
}
@media(max-width:589px){
.category-grid{grid-template-columns:1fr}
.category-grid>.directory-section{height:max(360px,calc(100svh - 144px))}
}

.home-activity{grid-column:1/-1;display:grid;grid-template-columns:1fr auto;gap:8px;background:#c9e9f2;border:1px dashed #5ca2b7;border-radius:12px;padding:12px 16px;color:#3088a3}
.home-activity h2{margin:0;font-size:18px}
.home-activity>a{align-self:center;padding:4px 0;font-size:14px}
.home-activity-items{grid-column:1/-1;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
.home-activity-items>a{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:2px 8px;padding:8px 10px;border-radius:8px;background:#ffffffa6;min-width:0}
.home-activity-items strong{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.home-activity-items span,.home-activity-items time{font-size:12px;color:#527f8d}
.home-activity-items time{grid-column:1/-1}
@media(max-width:767px){
.home-activity{padding:10px 12px}
.home-activity-items{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.home-activity-items>a{grid-template-columns:1fr;gap:0;padding:6px 8px}
}
.search-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}
.search-grid>.site-card:nth-child(n){grid-column:auto;margin:0}
.search-grid .site-card .card-preview{aspect-ratio:4/3}
.search-grid .site-card .site-link{font-size:14px}
.search-grid .site-status{display:none}
.search-grid>.empty-message{grid-column:1/-1}
@media(max-width:767px){
.search-page{padding:12px 10px}
.search-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
}
