:root {
    color-scheme: light;
    --background: #f5f6f8;
    --surface: #ffffff;
    --surface-muted: #eceef2;
    --text: #191c20;
    --text-muted: #70757d;
    --border: #dedfe3;
    --accent: #202124;
    --focus: rgba(32, 33, 36, 0.12);
    --shadow: 0 8px 24px rgba(20, 24, 32, 0.05);
    --max-width: 1120px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--background);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--background);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

.dashboard {
    width: min(calc(100% - 48px), var(--max-width));
    margin: 0 auto;
}

.search-section {
    display: flex;
    min-height: 43vh;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 72px 0 64px;
    text-align: center;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.search-section h1 {
    margin: 0 0 32px;
    font-size: clamp(2rem, 5vw, 3.35rem);
    font-weight: 650;
    letter-spacing: -0.045em;
    line-height: 1.08;
}

.search-form {
    width: min(100%, 680px);
}

.search-box {
    display: flex;
    align-items: center;
    height: 64px;
    padding: 0 10px 0 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow);
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}

.search-box:focus-within {
    border-color: #a8abb0;
    box-shadow: 0 0 0 5px var(--focus), 0 12px 32px rgba(20, 24, 32, 0.07);
    transform: translateY(-1px);
}

.search-icon {
    width: 21px;
    height: 21px;
    flex: 0 0 auto;
    fill: none;
    stroke: #888d94;
    stroke-linecap: round;
    stroke-width: 1.8;
}

.search-box input {
    min-width: 0;
    flex: 1;
    padding: 0 16px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 1.05rem;
}

.search-box input::placeholder {
    color: #9a9ea5;
}

.search-submit {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    place-items: center;
    border: 0;
    border-radius: 13px;
    background: var(--accent);
    color: #ffffff;
    cursor: pointer;
    transition:
        background-color 160ms ease,
        transform 160ms ease;
}

.search-submit:hover {
    background: #3a3d42;
    transform: translateX(1px);
}

.search-submit:focus-visible {
    outline: 3px solid rgba(32, 33, 36, 0.2);
    outline-offset: 2px;
}

.search-submit svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.search-engines {
    display: inline-flex;
    margin: 16px 0 0;
    padding: 4px;
    gap: 2px;
    border: 0;
    border-radius: 12px;
    background: var(--surface-muted);
}

.engine-option {
    position: relative;
    cursor: pointer;
}

.engine-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.engine-option span {
    display: block;
    min-width: 74px;
    padding: 7px 12px;
    border-radius: 9px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    transition:
        background-color 150ms ease,
        box-shadow 150ms ease,
        color 150ms ease;
}

.engine-option input:checked + span {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 4px rgba(20, 24, 32, 0.08);
}

.engine-option input:focus-visible + span {
    outline: 2px solid #6e737a;
    outline-offset: 2px;
}

.navigation-section {
    padding: 16px 0 56px;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.section-heading .eyebrow {
    margin-bottom: 6px;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(1.45rem, 3vw, 1.85rem);
    font-weight: 650;
    letter-spacing: -0.03em;
}

.section-note {
    margin: 0 0 3px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.category {
    display: grid;
    grid-template-columns: 176px minmax(0, 1fr);
    gap: 28px;
    padding: 28px 0;
    border-bottom: 1px solid var(--border);
}

.category-header {
    padding-top: 4px;
}

.category-index {
    display: block;
    margin-bottom: 9px;
    color: #a1a5ab;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.category-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 650;
    line-height: 1.4;
}

.site-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(166px, 1fr));
    gap: 14px;
}

.site-card {
    display: flex;
    min-width: 0;
    min-height: 104px;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid #e3e4e7;
    border-radius: 17px;
    background: var(--surface);
    box-shadow: 0 2px 10px rgba(20, 24, 32, 0.025);
    transition:
        border-color 170ms ease,
        box-shadow 170ms ease,
        transform 170ms ease;
}

.site-card:hover {
    border-color: #d2d4d8;
    box-shadow: 0 10px 24px rgba(20, 24, 32, 0.07);
    transform: translateY(-3px);
}

.site-card:focus-visible {
    outline: 3px solid rgba(32, 33, 36, 0.18);
    outline-offset: 3px;
}

.site-icon {
    position: relative;
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    place-items: center;
    overflow: hidden;
    border-radius: 13px;
    background: var(--icon-background, #f0f1f3);
    color: var(--icon-color, #36393e);
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: -0.02em;
}

.site-icon img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 10px;
    object-fit: contain;
    background: var(--surface);
}

.site-icon img.is-hidden {
    display: none;
}

.site-details {
    min-width: 0;
}

.site-name {
    display: block;
    overflow: hidden;
    font-size: 0.9rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-host {
    display: block;
    margin-top: 5px;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-footer {
    display: flex;
    width: min(calc(100% - 48px), var(--max-width));
    margin: 0 auto;
    padding: 0 0 32px;
    gap: 8px;
    color: #989ca2;
    font-size: 0.75rem;
}

.dashboard-footer p {
    margin: 0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 760px) {
    .dashboard,
    .dashboard-footer {
        width: min(calc(100% - 32px), var(--max-width));
    }

    .search-section {
        min-height: auto;
        padding: 92px 0 68px;
    }

    .search-section h1 {
        margin-bottom: 26px;
    }

    .section-note {
        display: none;
    }

    .category {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 24px 0;
    }

    .category-header {
        display: flex;
        align-items: baseline;
        gap: 10px;
        padding: 0;
    }

    .category-index {
        margin: 0;
    }
}

@media (max-width: 480px) {
    .dashboard,
    .dashboard-footer {
        width: min(calc(100% - 24px), var(--max-width));
    }

    .search-section {
        padding: 72px 0 54px;
    }

    .search-box {
        height: 58px;
        padding-left: 16px;
        border-radius: 17px;
    }

    .search-box input {
        padding: 0 12px;
        font-size: 1rem;
    }

    .search-submit {
        width: 40px;
        height: 40px;
        border-radius: 11px;
    }

    .engine-option span {
        min-width: 68px;
        padding-inline: 9px;
    }

    .site-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .site-card {
        min-height: 118px;
        flex-direction: column;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        padding: 14px;
    }

    .site-icon {
        width: 40px;
        height: 40px;
        border-radius: 11px;
    }

    .site-host {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
