.changes-strip, .directory-section { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; }
.changes-strip {
    display: flex; align-items: center; gap: clamp(8px, 1vw, 16px); margin-bottom: var(--item-gap); padding: 0 clamp(10px, 2vw, 22px);
}
.changes-strip h2 { justify-self: start; margin: 0; font-size: 16px; white-space: nowrap; }
.change-entry { flex: 1 1 auto; min-width: 0; display: grid; align-content: center; min-height: 48px; }
.change-entry small { font-size: 12px; }
.change-entry :is(.access-badge, time) { white-space: nowrap; }
.changes-all { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--accent); font-size: 12px; font-weight: 650; white-space: nowrap; }
.home-directory { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: start; }
.directory-section { line-height: 20px; display: flex; min-width: 0; flex-direction: column; height: 620px; overflow: hidden; }
.category-cover { --cover-inset: 16px; flex: none; container-type: inline-size; }
.category-cover h2 {
    position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center;
    margin: 0; padding: 7px var(--cover-inset); font-size: 16px; word-break: keep-all;
}
.category-cover h2::before {
    content: ""; position: absolute; z-index: -2; right: 0; top: 50%; transform: translateY(-50%);
    width: max(100%, 276px); min-height: 100%; aspect-ratio: 6;
    background: url("../icons/category-covers.webp?v=7") var(--cover-position) / 300% 900% no-repeat;
}
.category-cover h2::after {
    content: ""; position: absolute; z-index: -1; inset: 0;
    background: linear-gradient(to bottom, transparent 42%, var(--panel));
}
.category-badge {
    display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 4px 10px;
    border: 1px solid color-mix(in srgb, var(--ink) 15%, transparent); border-radius: 10px;
    background: color-mix(in srgb, var(--panel) 88%, transparent); color: var(--ink); font-weight: 650;
}
.category-badge:focus-visible { outline-offset: -3px; }
.category-badge b { display: inline-grid; place-content: center; min-width: 20px; height: 20px; padding-inline: 3px; border-radius: 20px; background: color-mix(in srgb, var(--accent) 12%, var(--panel)); color: var(--accent); font-size: 11px; font-variant-numeric: tabular-nums; }
@container (max-width: 285px) {
    .category-badge { padding-inline: 9px; gap: 6px; font-size: 14px; }
}
.category-cover p { margin: var(--item-gap) var(--cover-inset) 0; font-size: 14px; line-height: 21px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.directory-section .section-rows { overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--control-border) transparent; flex: 1; min-height: 0; margin-top: var(--item-gap); padding-inline: 16px; }
@media (min-width: 1025px) {
    .home-directory { column-gap: 20px; }
    .home-directory .site-link::before, .home-directory .site-link::after { display: none; }
    :is(.row-menu, .tile-actions):not(:has(a:is(:hover, :focus-visible, :active))) a:first-child { background: var(--accent); }
}
.section-item { min-width: 0; position: relative; }
.section-item + .section-item { margin-top: 6px; }
.site-row-head { display: flex; align-items: flex-start; min-width: 0; min-height: 44px; gap: 6px; padding: 4px 0 0; }
.home-directory .site-row-head { content-visibility: auto; contain-intrinsic-block-size: auto 50px; }
.row-rank { display: inline-grid; place-items: center; flex: none; min-width: 22px; height: 22px; padding: 0 3px; border-radius: 20px; font: 14px/1 Arial,sans-serif; background: #ececec; color: var(--muted); }
.site-logo { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; object-position: 12% center; }
.preview-placeholder { display: grid; place-items: center; aspect-ratio: 2.43; color: #ddd; background: var(--preview-shade), radial-gradient(at 50% 35%, #555, #202020); }
.preview-placeholder .site-logo { width: min(58%, 170px); height: min(24%, 44px); object-fit: contain; object-position: center; border-radius: 0; }
.site-name-line { display: flex; align-items: center; gap: 4px; min-width: 0; }
.site-name, .category-sidebar nav strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.access-badge { padding: 0 4px; border-radius: 3px; font-size: 12px; }
.access-badge.moved { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
.access-badge.reachable { color: var(--success); background: #e1f3e9; }
.access-badge.blocked { color: var(--warning); background: #fff0d9; }
.access-badge.offline { color: var(--danger); background: #ffe4e8; }
.new-badge { color: var(--accent); font-size: 11px; font-weight: 700; }
.site-row-actions { display: inline-flex; align-items: center; gap: 3px; }
.bookmark-btn, .row-arrow { display: inline-grid; place-items: center; flex: none; border: 0; padding: 1px; background: transparent; color: var(--muted); }
.compact-row { --row-logo-width: 84px; }
.compact-row .row-rank { margin-top: 4px; }
.compact-row .site-link { display: grid; flex: 1; min-width: 0; grid-template-columns: var(--row-logo-width) minmax(0, 1fr); gap: 1px 6px; align-items: center; padding: 1px 16px 0 0; }
.compact-row .site-link > :is(.site-logo, .inline-icon) { width: var(--row-logo-width); height: 28px; border-radius: 5px; object-fit: fill; }
.compact-row .site-name-line { grid-area: 2 / 1 / 3 / -1; }
:is(.compact-row, .change-entry) .site-name, .category-sidebar nav strong { font-size: 16px; font-weight: 500; line-height: 20px; }
.section-item:has([aria-current="page"]), .category-sidebar a[aria-current="page"] { background: var(--selected-bg); border-radius: 8px; border-color: transparent; }
[aria-current="page"] .site-name, .category-sidebar [aria-current="page"] strong { color: var(--accent); font-weight: 700; }
.row-meta { grid-area: 1 / 2; display: flex; min-width: 0; flex-wrap: wrap; align-items: center; column-gap: 3px; font-size: 12px; line-height: 16px; color: var(--muted); overflow: hidden; }
.row-arrow { position: absolute; right: 2px; top: 5px; width: 24px; height: 24px; }
.row-arrow::after { content: ""; }
.row-arrow::after, .compact-row .site-link::after { width: 7px; height: 7px; border: solid currentColor; border-width: 1px 1px 0 0; transform: rotate(45deg); }
.compact-row .site-link::before { content: ""; position: absolute; inset: 0; }
.compact-row .site-link::after { content: ""; position: absolute; top: 13px; right: 10px; color: var(--muted); }
.row-menu, :is(.row-menu, .tile-actions) a { background: var(--ink); color: white; }
.site-row-head > .row-visit { display: none; }
.row-menu { display: none; position: absolute; z-index: 1; left: calc(34px + var(--row-logo-width)); right: 0; top: 0; height: 32px; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 2px; overflow: hidden; border-radius: 8px; }
.row-menu a { display: grid; place-items: center; border-radius: 8px; font-size: 13px; font-weight: 500; word-break: keep-all; text-align: center; line-height: 1; }
:is(.row-menu, .tile-actions) a:focus-visible { outline-color: white; }
:is(.row-menu, .tile-actions) a:hover, :is(.row-menu, .tile-actions):not(:has(a:hover)) a:is(:focus-visible,:active) { background: var(--accent); text-decoration: none; outline-offset: -3px; }
@media (hover: hover) {
    .compact-row:has(.row-menu a[target="_blank"]:is(:hover,:focus-visible)) .row-meta { color: var(--accent); }
}
.compact-row:has(.row-arrow[aria-expanded="true"]) .row-menu { display: grid; animation: row-reveal .14s ease-out; }
.compact-row:has(.row-arrow[aria-expanded="true"]) .row-meta { visibility: hidden; }
.compact-row .bookmark-btn { position: absolute; z-index: 1; left: 0; top: 4px; width: 20px; height: 24px; opacity: 0; pointer-events: none; }
.compact-row .bookmark-btn:is(:focus-visible, .bookmarked), .compact-row:has(.row-arrow[aria-expanded="true"]) .bookmark-btn { opacity: 1; pointer-events: auto; background: var(--panel); }
@media (hover: hover) and (pointer: fine) {
    .detail-layout .compact-row:hover .bookmark-btn { opacity: 1; pointer-events: auto; background: var(--panel); }
}
@keyframes row-reveal { from { opacity: 0; transform: translateX(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .compact-row:has(.row-arrow[aria-expanded="true"]) .row-menu { animation: none; }
}
.bookmark-btn .icon-star { fill: none; stroke: currentColor; }
.bookmark-btn.bookmarked .icon-star { color: #b2780c; fill: currentColor; }
.visited-mark { display: inline-flex; flex: none; }
.site-link .visited-mark { color: var(--muted); }
.section-viewall, .share-button {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px;
    min-height: 40px; border: 1px solid var(--border); border-radius: 12px; background: transparent; color: var(--ink); font-size: 12px; font-weight: 650;
}
.section-viewall { margin: 10px 16px 16px; flex: none; font-size: 14px; font-weight: 500; }
.section-viewall b { color: var(--accent); font-weight: 600; }
.section-viewall:hover, .share-button:hover { border-color: var(--control-border); background: var(--soft); text-decoration: none; }
@media (max-width: 1199px) {
    .changes-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 0; }
    .changes-strip h2 { grid-area: 1 / 1 / 2 / -2; }
    .changes-all { grid-row: 1; grid-column: -2 / -1; justify-self: end; min-height: 36px; }
    .change-entry { min-height: 44px; border-top: 1px solid var(--border); }
}
@media (max-width: 1024px) {
    .directory-section .row-arrow { display: none; }
    :is(.row-menu, .tile-actions) a[target="_blank"] { background: var(--accent); }
    .home-directory { grid-template-columns: 1fr; }
    .directory-section { height: 450px; }
    .category-cover { --cover-inset: 10px; }
    .directory-section .section-rows { padding-inline: 10px; }
    .section-viewall { margin-inline: 10px; }
}
@media (min-width: 590px) and (max-width: 1024px) {
    .home-directory { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 589px) {
    .changes-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .change-entry:nth-of-type(n+5) { display: none; }
    .directory-section { height: max(360px, calc(100svh - 144px)); }
}
@media (max-width: 359px) {
    .row-menu a { font-size: 12px; }
}
