body{

    --page-bg:#050505;
    --text-color:#3b82f6;
    --heading-color:#cbd5e1;
    --muted-color:#cbd5e1;
    --control-bg:rgba(255,255,255,.05);
    --control-border:rgba(255,255,255,.10);
    --control-hover:rgba(59,130,246,.08);
    --nav-border:rgba(255,255,255,.10);
    --panel-bg:rgba(255,255,255,.025);
    --panel-open-bg:rgba(255,255,255,.04);
    --panel-border:rgba(255,255,255,.08);
    --panel-open-border:rgba(59,130,246,.3);
    --card-bg:#1b2028;
    --card-hover:#252c37;
    --card-text:#e2e8f0;
    --icon-bg:#171c25;
    --focus-color:#60a5fa;
    --link-outline:rgba(59,130,246,.35);

    margin:0;
    background:var(--page-bg);
    color:var(--text-color);
    font-family:Inter,Arial,sans-serif;
    color-scheme:dark;
}

body[data-theme="light"]{

    --page-bg:#f3f6fb;
    --text-color:#1d4ed8;
    --heading-color:#1e293b;
    --muted-color:#475569;
    --control-bg:rgba(255,255,255,.9);
    --control-border:rgba(15,23,42,.14);
    --control-hover:rgba(37,99,235,.09);
    --nav-border:rgba(15,23,42,.12);
    --panel-bg:rgba(255,255,255,.78);
    --panel-open-bg:#fff;
    --panel-border:rgba(15,23,42,.12);
    --panel-open-border:rgba(37,99,235,.35);
    --card-bg:#fff;
    --card-hover:#eff6ff;
    --card-text:#1e293b;
    --icon-bg:#e8eef6;
    --focus-color:#2563eb;
    --link-outline:rgba(37,99,235,.35);

    color-scheme:light;
}

.header{

    position:fixed;

    top:20px;
    left:20px;
    right:20px;

    display:flex;

    justify-content:space-between;
    align-items:center;

    z-index:1000;
}

.btn{

    width:42px;
    height:42px;

    display:flex;
    align-items:center;
    justify-content:center;

    border-radius:12px;

    border:1px solid var(--control-border);

    background:var(--control-bg);

    color:var(--text-color);

    cursor:pointer;

    transition:.2s ease;
}

.btn:hover{

    background:var(--control-hover);
}

.menu-icon{

    width:20px;
    height:20px;

    display:block;
}

.nav{

    position:fixed;

    left:-280px;
    top:0;

    width:280px;
    height:100vh;
    box-sizing:border-box;

    background:var(--page-bg);
    border-right:1px solid var(--nav-border);

    padding:80px 30px;

    transition:left .25s ease;

    z-index:999;
}

.nav.open{
    left:0;
}

.nav a{

    display:block;

    color:var(--text-color);

    text-decoration:none;

    margin:16px 0;
}

main{

    min-height:100vh;

    display:flex;
    flex-direction:column;

    justify-content:center;
    align-items:center;
}

.home-content{

    box-sizing:border-box;
    display:flex;
    flex-direction:column;
    justify-content:center;
    gap:0;

    max-width:1680px;
    min-height:100vh;
    margin:0 auto;
    padding:88px 24px 28px;
}

.home-main{
    min-height:0;

    display:flex;
    justify-content:center;
    align-items:center;
}

.home-brand{

    display:flex;
    flex-direction:column;
    align-items:center;
    gap:10px;
    text-align:center;
}

.home-brand-copy{
    min-width:0;
    text-align:center;
}

.title{

    margin:0;

    font-size:clamp(2.5rem,5vw,4rem);
    line-height:1;
    letter-spacing:-.04em;
}

.tagline{

    margin:8px 0 0;

    opacity:.65;
    font-size:.95rem;
}

.page{

    max-width:900px;

    padding:120px 32px;

    margin:auto;
}

.links-page{

    box-sizing:border-box;
    max-width:1680px;
    min-height:100vh;
    margin:0 auto;
    padding:112px 24px 40px;
}

.links-page .link-directory{
    grid-template-columns:1fr;
    max-width:900px;
    gap:12px;
}

.link-editor{
    box-sizing:border-box;
    width:min(100%, 680px);
    padding:112px 24px 40px;
    justify-content:flex-start;
    align-items:stretch;
}

.link-editor h1{
    margin:0 0 12px;
    color:var(--heading-color);
}

.link-editor > p{
    margin:0 0 12px;
    line-height:1.55;
}

.editor-note{
    color:var(--muted-color);
    font-size:.9rem;
}

.editor-form{
    display:grid;
    gap:10px;
    margin-top:16px;
}

.editor-form label{
    color:var(--heading-color);
    font-weight:600;
}

.editor-form input,
.editor-form select{
    box-sizing:border-box;
    width:100%;
    min-height:42px;
    padding:9px 11px;
    border:1px solid var(--control-border);
    border-radius:8px;
    background:var(--control-bg);
    color:var(--heading-color);
    font:inherit;
}

.editor-form fieldset{
    display:grid;
    gap:10px;
    min-width:0;
    margin:8px 0;
    padding:0;
    border:0;
}

.editor-form [hidden]{
    display:none;
}

.editor-form input:focus-visible,
.editor-form select:focus-visible,
.editor-submit:focus-visible,
.editor-cancel:focus-visible{
    outline:2px solid var(--focus-color);
    outline-offset:2px;
}

.editor-actions{
    display:flex;
    gap:10px;
}

.editor-submit{
    min-height:44px;
    padding:10px 16px;
    border:1px solid var(--panel-open-border);
    border-radius:8px;
    background:var(--control-hover);
    color:var(--heading-color);
    font:inherit;
    font-weight:600;
    cursor:pointer;
    flex:1;
}

.editor-cancel{
    display:inline-flex;
    min-height:44px;
    flex:1;
    align-items:center;
    justify-content:center;
    box-sizing:border-box;
    padding:10px 16px;
    border:1px solid var(--control-border);
    border-radius:8px;
    background:var(--control-bg);
    color:var(--heading-color);
    font-weight:600;
    text-decoration:none;
}

.editor-status{
    min-height:1.4em;
    margin:0;
    color:var(--muted-color);
}

.editor-status[data-error="true"]{
    color:#dc2626;
}

#setupContent h2{
    margin-top:32px;
}

#setupContent hr{
    border:0;
    border-top:1px solid var(--panel-border);
    margin:24px 0;
}

#setupContent blockquote{
    border-left:2px solid #3b82f6;
    margin:24px 0;
    padding-left:16px;
    opacity:.7;
}

#setupContent code{
    font-family:Consolas,monospace;
}

.logo{

    width:56px;
    height:56px;
}

.link-directory{

    display:grid;
    grid-template-columns:repeat(4, minmax(0, 1fr));
    align-items:start;
    gap:14px;

    width:100%;
    max-width:1520px;
    margin:0 auto;

    background:var(--page-bg);
}

.link-category{

    min-width:0;
    padding:11px;

    border:1px solid var(--panel-border);
    border-radius:12px;
    background:var(--panel-bg);
}

.link-category[open]{
    border-color:var(--panel-open-border);
    background:var(--panel-open-bg);
}

.category-toggle{

    min-height:24px;

    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;

    cursor:pointer;
    list-style:none;
    user-select:none;
}

.category-toggle::-webkit-details-marker{
    display:none;
}

.category-toggle h2{

    margin:0;

    color:var(--heading-color);
    font-size:.95rem;
    font-weight:600;
}

.category-toggle:focus-visible{
    outline:2px solid var(--focus-color);
    outline-offset:4px;
    border-radius:4px;
}

.category-chevron{

    width:7px;
    height:7px;
    margin-right:3px;
    flex-shrink:0;

    border-right:1.5px solid var(--muted-color);
    border-bottom:1.5px solid var(--muted-color);

    transform:rotate(45deg);
    transition:transform .2s ease;
}

.link-category[open] .category-chevron{
    transform:rotate(225deg);
}

.link-list{

    display:grid;
    gap:6px;
    margin-top:9px;
}

.service-link{

    min-width:0;
    min-height:26px;

    display:grid;
    grid-template-columns:30px minmax(0, 1fr) auto;
    align-items:center;
    gap:8px;

    padding-right:7px;

    border-radius:6px;

    background:var(--card-bg);
    color:var(--card-text);

    text-decoration:none;
    transition:background .2s ease, box-shadow .2s ease;
}

.service-link:hover{
    background:var(--card-hover);
    box-shadow:0 0 0 1px var(--link-outline);
}

.service-link:focus-visible{
    outline:2px solid var(--focus-color);
    outline-offset:3px;
}

.service-icon{

    box-sizing:content-box;
    width:18px;
    height:18px;
    padding:4px 6px;
    flex-shrink:0;

    border-radius:6px 0 0 6px;

    background:var(--icon-bg);
    object-fit:contain;
}

.service-icon--cover{
    object-fit:cover;
}

.service-icon--left{
    object-position:left center;
}

.service-icon--right{
    object-position:right center;
}

.link-status{
    grid-column:1 / -1;
    margin:0;
    color:var(--muted-color);
}

.link-load-error{
    grid-column:1 / -1;
    margin:0;
    padding:12px;
    border:1px solid var(--panel-border);
    border-radius:8px;
    background:var(--panel-bg);
    color:var(--heading-color);
}

.service-name,
.service-domain{

    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.service-name{
    font-size:.7rem;
}

.service-domain{

    margin-left:auto;

    color:var(--muted-color);
    font-size:.68rem;
}

@media (max-width: 1000px){
    .link-directory{
        grid-template-columns:repeat(2, minmax(0, 1fr));
        gap:14px;
    }
}

@media (max-width: 600px){
    .header{
        top:12px;
        left:12px;
        right:12px;
    }

    .btn{
        width:44px;
        height:44px;
    }

    .nav{
        width:min(280px, 85vw);
        height:100vh;
        height:100dvh;
        padding:76px 24px;
    }

    .nav a{
        margin:20px 0;
        font-size:1.05rem;
    }

    .page{
        box-sizing:border-box;
        width:100%;
        padding:88px 20px 32px;
    }

    .page h1{
        font-size:clamp(1.75rem, 8vw, 2.25rem);
    }

    .page h2{
        font-size:1.25rem;
    }

    .page p,
    #setupContent{
        font-size:1rem;
        line-height:1.6;
    }

    .links-page{
        padding:88px 12px 24px;
    }

    .link-editor{
        padding:88px 20px 32px;
    }

    .links-page .link-directory{
        grid-template-columns:1fr;
    }

    .home-content{
        gap:0;
        padding:78px 12px 20px;
    }

    .home-brand{
        gap:8px;
    }

    .logo{
        width:48px;
        height:48px;
    }

    .title{
        font-size:clamp(2rem,9vw,2.5rem);
    }

    .tagline{
        margin-top:5px;
        font-size:.85rem;
    }

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

    .link-category{
        padding:12px;
        border-radius:10px;
    }

    .link-list{
        gap:6px;
        margin-top:8px;
    }

    .service-link{
        grid-template-columns:36px minmax(0, 1fr);
        gap:8px;
        min-height:44px;
        padding-right:8px;
        border-radius:6px;
    }

    .service-icon{
        width:22px;
        height:22px;
        padding:5px 7px;
        border-radius:6px 0 0 6px;
    }

    .category-toggle h2{
        font-size:1rem;
    }

    .service-name{
        font-size:.9rem;
    }

    .service-domain{
        display:none;
    }
}