@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --wd-bg: #07090d;
    --wd-surface: #11151d;
    --wd-surface-raised: #171d27;
    --wd-border: #293241;
    --wd-text: #f7f8fa;
    --wd-muted: #96a0af;
    --wd-red: #ef4444;
    --wd-blue: #60a5fa;
    --wd-green: #34d399;
    --wd-radius: 14px;
    --wd-shadow: 0 18px 50px rgba(0, 0, 0, .28);
    --wd-shadow-soft: 0 8px 28px rgba(0, 0, 0, .2);
    --wd-page-width: 1240px;
    --wd-page-gutter: clamp(1rem, 3vw, 2rem);
    --wd-focus: 0 0 0 3px rgba(96, 165, 250, .22);
    color-scheme: dark;
}

.wd-shell {
    position: sticky;
    top: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    min-height: 72px;
    padding: .75rem clamp(1rem, 3vw, 2rem);
    background: rgba(7, 9, 13, .92);
    border-bottom: 1px solid var(--wd-border);
    backdrop-filter: blur(18px);
}

.wd-shell__brand { display: flex; align-items: center; gap: .75rem; color: var(--wd-text); text-decoration: none; }
.wd-shell__logo { width: 42px; height: 42px; border-radius: 10px; object-fit: contain; }
.wd-shell__wordmark { font-weight: 850; letter-spacing: .08em; }
.wd-shell__wordmark span { color: var(--wd-red); }
.wd-shell__page { display: block; margin-top: .1rem; color: var(--wd-muted); font-size: .69rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.wd-shell__nav { display: flex; align-items: center; gap: .3rem; margin-left: auto; }
.wd-shell__nav--public { display: flex; }
.wd-shell__link, .wd-shell__logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: .62rem .78rem;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--wd-muted);
    font: inherit;
    font-size: .78rem;
    font-weight: 750;
    letter-spacing: .025em;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}
.wd-shell__link:hover, .wd-shell__link[aria-current="page"] { color: var(--wd-text); background: var(--wd-surface-raised); border-color: var(--wd-border); }
.wd-shell__link[aria-current="page"] { box-shadow: inset 0 -2px var(--wd-red); }
.wd-shell__logout:hover { color: var(--wd-red); }
.wd-shell__user { max-width: 170px; overflow: hidden; padding: 0 .55rem; color: var(--wd-muted); font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.wd-shell__menu { display: none; min-width: 44px; min-height: 44px; margin-left: auto; border: 1px solid var(--wd-border); border-radius: 9px; background: var(--wd-surface); color: var(--wd-text); padding: .55rem .7rem; }

/* Shared shell dropdowns. */
.wd-shell__group { position: relative; }
.wd-shell__grouptoggle { appearance: none; gap: .35rem; margin: 0; }
.wd-shell__caret { font-size: .58rem; }
.wd-shell__pop { position: absolute; top: calc(100% + .4rem); right: 0; z-index: 950; display: none; flex-direction: column; min-width: 172px; padding: .35rem; border: 1px solid var(--wd-border); border-radius: 11px; background: var(--wd-surface-raised); box-shadow: var(--wd-shadow); }
.wd-shell__group[data-open="true"] .wd-shell__pop { display: flex; }
.wd-shell__pop .wd-shell__link, .wd-shell__pop .wd-shell__logout { display: block; width: 100%; text-align: left; }
.wd-shell__poplabel { padding: .3rem .55rem .15rem; color: var(--wd-muted); font-size: .6rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

/* Shared product primitives. Legacy pages can adopt these incrementally. */
.wd-card { border: 1px solid var(--wd-border); border-radius: var(--wd-radius); background: var(--wd-surface); box-shadow: var(--wd-shadow); }
.wd-button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 40px; padding: .6rem .85rem; border: 1px solid var(--wd-border); border-radius: 9px; background: var(--wd-surface-raised); color: var(--wd-text); font: inherit; font-size: .8rem; font-weight: 750; text-decoration: none; cursor: pointer; }
.wd-button:hover { border-color: var(--wd-blue); }
.wd-button--primary { border-color: var(--wd-red); background: var(--wd-red); color: #fff; }
.wd-badge { display: inline-flex; align-items: center; padding: .2rem .45rem; border: 1px solid var(--wd-border); border-radius: 999px; color: var(--wd-muted); font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.wd-empty { padding: 2.5rem 1rem; color: var(--wd-muted); text-align: center; }
.wd-field { width: 100%; min-height: 40px; padding: .6rem .7rem; border: 1px solid var(--wd-border); border-radius: 9px; background: var(--wd-bg); color: var(--wd-text); font: inherit; }

.wd-button, .wd-field, .wd-shell__link, .wd-shell__logout, .wd-shell__menu { transition: border-color .18s ease, background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease; }
.wd-button:hover { transform: translateY(-1px); }
.wd-button:focus-visible, .wd-field:focus-visible, .wd-shell button:focus-visible, .wd-shell a:focus-visible { outline: 0; box-shadow: var(--wd-focus); }
.wd-field::placeholder { color: #667181; }

@media (max-width: 1120px) {
    .wd-shell { flex-wrap: wrap; }
    .wd-shell__menu { display: block; }
    .wd-shell__nav,
    .wd-shell__nav--public { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px); margin: .7rem 0 0; padding-bottom: max(.25rem, env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
    .wd-shell[data-open="true"] .wd-shell__nav { display: flex; }
    .wd-shell__link, .wd-shell__logout { min-height: 44px; }
    .wd-shell__user { max-width: none; padding: .5rem .78rem; }
    /* In the collapsed menu dropdown groups become full-width tappable sections. */
    .wd-shell__group { position: static; }
    .wd-shell__grouptoggle { width: 100%; justify-content: space-between; min-height: 44px; }
    .wd-shell__pop { position: static; min-width: 0; padding: .1rem 0 .45rem .75rem; border: 0; background: transparent; box-shadow: none; }
    .wd-shell__poplabel { display: none; }
}
