:root {
    color-scheme: dark;
    font-family: Inter, "Segoe UI", system-ui, sans-serif;
    color: #edf0f7;
    background: #0c1019;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 2px solid #b5a8ff; outline-offset: 4px; }
.shell { width: min(1200px, calc(100% - 64px)); margin-inline: auto; }

.site-header { border-bottom: 1px solid #222837; background: #101520; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-link { text-decoration: none; }
.brand img { width: 32px; height: 32px; object-fit: contain; }
.brand-name { font-size: 17px; font-weight: 650; letter-spacing: -0.4px; }
.preview-label { margin-left: 3px; padding-left: 14px; border-left: 1px solid #373d4d; color: #aaa5c9; font-size: 12px; }
.main-site { display: inline-flex; align-items: center; gap: 7px; color: #a4adbf; font-size: 12px; text-decoration: none; }
.main-site:hover { color: #d5ceff; }
.main-site svg { width: 14px; height: 14px; }

main { padding-block: 38px 48px; }
h1 { margin: 0 0 25px; font-size: clamp(24px, 3vw, 30px); font-weight: 650; letter-spacing: -0.9px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.filters { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid #252c3c; border-radius: 10px; background: #111722; }
.filter { min-height: 36px; padding: 7px 19px; border: 0; border-radius: 6px; background: transparent; color: #9ca6b9; font-size: 13px; font-weight: 550; cursor: pointer; }
.filter:hover { color: #f0edff; background: #1c2231; }
.filter[aria-pressed="true"] { background: #302943; color: #d8caff; box-shadow: inset 0 0 0 1px #514264; }
.search { position: relative; display: flex; align-items: center; width: 280px; max-width: 100%; }
.search svg { position: absolute; left: 13px; width: 17px; height: 17px; color: #8d98ad; pointer-events: none; }
.search input { width: 100%; height: 44px; padding: 10px 13px 10px 39px; border: 1px solid #2b3243; border-radius: 9px; background: #111722; color: #edf0f7; font-size: 13px; }
.search input::placeholder { color: #8e99ae; opacity: 1; }
.search input:focus { border-color: #9f8bcf; }

.catalog-section + .catalog-section { margin-top: 28px; }
h2 { display: flex; align-items: center; gap: 16px; margin: 0 0 13px; font-size: 13px; font-weight: 600; color: #aab4c7; }
h2::after { content: ""; height: 1px; flex: 1; background: #222a3b; }
.catalog-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 0; margin: 0; list-style: none; }
.catalog-card { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 84px; padding: 13px; background: #151c29; border: 1px solid #273044; border-radius: 10px; }
.catalog-card.catalog-card--linked { padding: 0; }
.catalog-link { display: flex; flex: 1; flex-direction: inherit; align-self: stretch; align-items: center; justify-content: inherit; gap: inherit; min-width: 0; width: 100%; padding: 13px; border-radius: inherit; text-decoration: none; }
.catalog-card--linked:hover, .catalog-card--linked:focus-within { background: #1d2334; border-color: #8e7cb5; }
.catalog-card img { flex: 0 0 54px; width: 54px; height: 54px; object-fit: contain; border-radius: 9px; }
.catalog-name { min-width: 0; font-size: 13px; font-weight: 550; line-height: 1.45; overflow-wrap: anywhere; }
.empty-state { margin: 0; padding: 50px 20px; text-align: center; color: #aab4c7; border: 1px dashed #313a4e; border-radius: 10px; }
.empty-state p { margin: 0 0 16px; }
.reset { padding: 9px 17px; border: 1px solid #514264; border-radius: 7px; background: #302943; color: #dfd3ff; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 1; padding: 12px 16px; background: #dfd3ff; color: #15101f; border-radius: 6px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

@media (max-width: 1100px) {
    .catalog-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .shell { width: calc(100% - 40px); }
    .catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .header-inner { min-height: 64px; }
    main { padding-top: 28px; }
    h1 { margin-bottom: 22px; }
    .toolbar { align-items: stretch; flex-direction: column; gap: 12px; margin-bottom: 25px; }
    .filters { align-self: flex-start; }
    .search { width: 100%; }
    .search input { font-size: 16px; }
    .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .catalog-card { flex-direction: column; justify-content: flex-start; gap: 10px; min-height: 124px; padding: 15px 10px; text-align: center; }
    .catalog-link { padding: 15px 10px; }
    .catalog-card img { flex-basis: 52px; width: 52px; height: 52px; }
    .catalog-name { font-size: 13px; }
    .main-site { font-size: 11px; gap: 4px; }
    .brand { gap: 8px; }
    .brand-name { font-size: 15px; }
    .preview-label { margin-left: 0; padding-left: 8px; font-size: 11px; }
}
@media (max-width: 360px) {
    .shell { width: calc(100% - 28px); }
    .main-site { font-size: 10px; }
    .brand img { width: 26px; height: 26px; }
    .header-inner { gap: 8px; }
}
