:root {
    color-scheme: light;
    --background: #f7f7fb;
    --surface: #fff;
    --ink: #1e1930;
    --muted: #605a70;
    --line: #e6e2ee;
    --purple: #6031d5;
    --purple-strong: #4c24b9;
    --tint: #eee8fc;
    --corner: 18px;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--background);
}

*, *::before, *::after { box-sizing: border-box; }
body { min-width: 0; margin: 0; font-size: 1rem; line-height: 1.5; }
button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }
a { color: var(--purple-strong); }
a, button, input, textarea, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #7950e7; outline-offset: 3px; }
[hidden] { display: none !important; }
svg { flex: none; vertical-align: middle; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.038em; overflow-wrap: anywhere; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.3rem); }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.17rem; }
p { overflow-wrap: anywhere; }

.sr-only, .skip:not(:focus) {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip:focus { position: fixed; z-index: 5; left: 1rem; top: 1rem; background: white; padding: .7rem 1rem; border-radius: 8px; }

.app { display: grid; grid-template-columns: 226px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 2.7rem;
    padding: 1.3rem 1rem 1rem;
    border-right: 1px solid var(--line);
    background: #fdfcff;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    width: fit-content;
    font-size: 1.03rem;
    font-weight: 760;
    letter-spacing: -.04em;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 37px;
    height: 37px;
    color: white;
    background: linear-gradient(145deg, #8c5bf6, #5827cd 65%, #442098);
    border-radius: 11px;
    box-shadow: 0 4px 10px #5a33c235;
}
.brand-second { color: var(--purple); }
.nav { display: grid; gap: .31rem; }
.nav-label { padding: 0 .75rem .3rem; color: var(--muted); font-size: .75rem; letter-spacing: .105em; font-weight: 750; }
.nav a {
    display: flex; align-items: center; gap: .7rem; padding: .73rem .75rem; border-radius: 10px;
    color: var(--muted); font-weight: 625; font-size: .93rem; text-decoration: none;
}
.nav a:hover { background: #f4f0fb; color: var(--purple-strong); }
.nav a[aria-current="page"] { color: var(--purple-strong); background: var(--tint); }
.sidebar-foot {
    margin-top: auto; display: flex; align-items: center; gap: .5rem; padding: .72rem .65rem;
    border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: .8rem;
}
.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    min-height: 72px; padding: .65rem clamp(1.25rem, 3.3vw, 3.5rem);
    border-bottom: 1px solid var(--line); background: #fdfcff;
}
.breadcrumb { display: flex; gap: .53rem; align-items: center; color: var(--muted); font-size: .9rem; }
.breadcrumb strong { color: var(--ink); font-weight: 690; }
.account, .account-link { display: flex; align-items: center; gap: .68rem; min-width: 0; }
.account-name { max-width: 16ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-link { text-decoration: none; color: var(--ink); font-size: .9rem; font-weight: 680; }
.avatar-small { display: grid; flex: none; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--purple-strong); background: var(--tint); font-size: .77rem; }
.icon-button, .search-form button {
    display: grid; place-items: center; width: 42px; height: 42px; border: 0;
    border-radius: 8px; background: transparent; color: var(--muted);
}
.icon-button:hover, .search-form button:hover { color: var(--purple-strong); background: var(--tint); }
.content { width: 100%; max-width: 1510px; margin-inline: auto; padding: 1.9rem clamp(1.25rem, 3.3vw, 3.5rem) 3.2rem; }

.hero, .auth-art, .profile-cover {
    background-color: #19102e;
    background-image: url("hero.webp"), radial-gradient(ellipse at 82% 38%, #452175, #19102e 62%);
    background-repeat: no-repeat;
    background-position: center right;
    background-size: cover;
}
.hero {
    border-radius: 20px; min-height: 278px; display: flex; align-items: center;
    position: relative; overflow: hidden; isolation: isolate; color: #fff;
    box-shadow: 0 13px 28px -19px #2414528c;
}
.hero::before, .auth-art::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(90deg, #170d2a 1%, #170d2ae8 30%, #170d2a88 53%, transparent 79%);
}
.hero-content { width: min(680px, 78%); padding: 2rem clamp(1.45rem, 4vw, 3rem); }
.hero h1 { margin: .64rem 0 .64rem; font-size: clamp(2.3rem, 4.2vw, 4rem); letter-spacing: -.052em; }
.hero p, .auth-art p { color: #e1d7f1; max-width: 35rem; }
.hero-kicker {
    display: flex; align-items: center; gap: .55rem; color: #e1ceff; font-size: .76rem;
    font-weight: 760; letter-spacing: .13em;
}
.hero-kicker span { width: 7px; height: 7px; border: 1px solid #c39dff; transform: rotate(45deg); background: #c39dff; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.35rem; }
.hero-meta span { display: inline-flex; align-items: center; gap: .35rem; padding: .31rem .67rem; border: 1px solid #c5aceb4d; border-radius: 8px; font-size: .87rem; color: #f5eeff; background: #cab3ec18; }
.roster { margin-top: 1.95rem; }
.roster-top, .roster-heading, .directory-tools { display: flex; align-items: center; }
.roster-top { gap: .8rem 1rem; justify-content: space-between; margin-bottom: .95rem; flex-wrap: wrap; }
.roster-heading { gap: .62rem; }
.count { color: var(--purple-strong); background: var(--tint); border-radius: 50px; min-width: 27px; padding: .12rem .43rem; text-align: center; font-size: .82rem; font-weight: 750; }
.directory-tools { gap: .55rem; flex-wrap: wrap; max-width: 100%; }
.group-form { display: flex; align-items: center; gap: .4rem; min-width: 0; max-width: 100%; }
.group-form select {
    min-width: 0; max-width: 235px; width: 100%; min-height: 44px; appearance: none;
    padding: .48rem 2rem .48rem .75rem; border: 1px solid var(--line); border-radius: 9px;
    color: var(--ink); background: var(--surface); font-size: .89rem;
    background-image: linear-gradient(45deg, transparent 50%, #736989 50%), linear-gradient(135deg, #736989 50%, transparent 50%);
    background-size: 5px 5px; background-position: calc(100% - 16px) center, calc(100% - 11px) center; background-repeat: no-repeat;
}
.js-group .group-submit { display: none; }
.search-form {
    display: flex; align-items: center; padding-right: .55rem; max-width: 100%;
    min-height: 44px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
}
.search-form button { width: 39px; height: 36px; margin: 2px; }
.search-form input { max-width: 100%; width: 165px; min-width: 0; padding: .39rem 0; border: 0; background: transparent; font-size: .9rem; color: var(--ink); }
.search-form input:focus-visible { outline-offset: 0; border-radius: 3px; }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.member-card {
    display: flex; flex-direction: column; min-width: 0; overflow: hidden;
    padding: .45rem; border: 1px solid var(--line); border-radius: 15px; background: var(--surface);
    color: var(--ink); text-decoration: none; transition: border-color .16s, box-shadow .16s, transform .16s;
}
.member-card:hover { border-color: #b39ae9; box-shadow: 0 10px 25px -16px #5439a877; transform: translateY(-2px); }
.portrait { display: grid; place-items: center; overflow: hidden; color: #5429b6; background: radial-gradient(ellipse at 45% 35%, #e6d9ff, #d6c2ff); font-weight: 750; font-size: 2rem; }
.portrait img { width: 100%; height: 100%; min-height: 0; object-fit: cover; object-position: center 39%; display: block; }
.card-photo { height: clamp(143px, 15vw, 229px); border-radius: 10px; }
.card-info { display: flex; flex: 1; justify-content: space-between; align-items: center; gap: .6rem; padding: .93rem .58rem .7rem; }
.card-info p { color: var(--muted); margin-top: .3rem; font-size: .9rem; }
.card-link { display: grid; place-items: center; width: 33px; height: 33px; flex: none; border-radius: 9px; background: var(--tint); color: var(--purple-strong); }

.button {
    display: inline-flex; width: fit-content; align-items: center; justify-content: center; gap: .4rem; min-height: 44px;
    padding: .57rem .94rem; border: 1px solid transparent; border-radius: 9px; text-decoration: none;
    font-size: .93rem; font-weight: 690; line-height: 1.22; text-align: center;
}
.primary { background: var(--purple); color: #fff; box-shadow: 0 5px 12px #6a3ddd31; }
.primary:hover { background: var(--purple-strong); }
.secondary { background: var(--surface); color: var(--ink); border-color: #dcd5e8; }
.secondary:hover { color: var(--purple-strong); border-color: #ae95e7; background: #f9f6ff; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--corner); }
.plain { width: min(100% - 2rem, 580px); margin: 2rem auto; }
.plain .panel, .empty { margin-top: 1.6rem; padding: 1.7rem; }
.plain p, .empty p { color: var(--muted); margin: .65rem 0 1rem; }

.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1fr); }
.auth-main { display: flex; flex-direction: column; align-items: flex-start; padding: clamp(1.25rem, 4.4vw, 3rem); background: var(--surface); }
.auth-form { width: min(100%, 430px); margin: auto; padding-block: 2.5rem; }
.auth-form h1 { margin-bottom: .55rem; }
.auth-form p { color: var(--muted); }
.auth-form form.fields { margin-top: 1.6rem; }
.auth-form .primary { width: 100%; }
.auth-form > .hint, .auth-form > .button { margin-top: .95rem; }
.demo-access { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin-top: 1.3rem; border-top: 1px solid var(--line); padding-top: 1.3rem; }
.auth-art {
    position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end;
    margin: .85rem; padding: clamp(1.5rem, 4vw, 3.6rem); border-radius: 22px; color: white;
    background-position: 65% center;
}
.auth-art::before { background: linear-gradient(0deg, #170d2a 1%, #170d2ae0 27%, transparent 68%); border-radius: inherit; }
.auth-art h2 { margin: .65rem 0 1rem; font-size: clamp(2.55rem, 5.8vw, 5.4rem); letter-spacing: -.06em; }

.profile, .edit { max-width: 830px; margin-inline: auto; }
.back-link { display: inline-block; margin-bottom: .95rem; font-weight: 650; text-decoration-thickness: 1px; text-underline-offset: .23em; }
.profile-panel { overflow: hidden; }
.profile-cover { min-height: 166px; background-position: center 51%; }
.profile-inner { position: relative; padding: 0 clamp(1.15rem, 4vw, 2rem) 2rem; }
.profile-photo { position: relative; width: 132px; height: 132px; margin-top: -61px; margin-bottom: 1rem; border: 5px solid var(--surface); border-radius: 18px; }
.profile-heading, .edit-heading { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .8rem; }
.profile-heading p, .edit-heading p { color: var(--muted); margin-top: .5rem; }
.profile-section { margin-top: 1.45rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.profile-section h2 { font-size: 1.21rem; margin-bottom: .5rem; }
.bio { white-space: pre-wrap; color: var(--muted); }
.profile-links { display: flex; flex-wrap: wrap; gap: .55rem; }
.public-header { background: #fdfcff; border-bottom: 1px solid var(--line); padding: .9rem clamp(1rem, 4vw, 3.2rem); }
.public-main { max-width: 870px; margin: auto; padding: 2rem 1rem 3rem; }

.edit-heading { margin-bottom: 1.15rem; }
.fields, .edit-form { display: grid; gap: .9rem; }
.fields label:not(.check) { display: block; min-width: 0; font-size: .94rem; font-weight: 665; }
.fields input:not([type="checkbox"]), .fields textarea {
    display: block; width: 100%; min-width: 0; min-height: 44px; margin-top: .34rem;
    padding: .55rem .68rem; border: 1px solid #dcd5e8; border-radius: 8px;
    background: #fdfcff; color: var(--ink); font-weight: 430;
}
.fields input[readonly] { background: #f3f0f7; }
.fields input[type="file"] { padding: .42rem; }
.fields textarea { resize: vertical; }
.hint, .optional, .check small { color: var(--muted); font-size: .87rem; font-weight: 430; }
.fields .hint { margin-top: -.32rem; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.edit-panel { padding: clamp(.95rem, 3.5vw, 1.65rem); }
.edit-panel h2 { font-size: 1.25rem; }
.photo-field { display: flex; align-items: flex-start; gap: .8rem; }
.photo-field > div:last-child { min-width: 0; }
.photo-field .hint { margin-top: .3rem; }
.edit-photo { flex: none; width: 78px; height: 78px; border-radius: 13px; font-size: 1.45rem; }
.check { display: flex; align-items: flex-start; gap: .6rem; min-height: 44px; font-size: .94rem; cursor: pointer; }
.check.simple { align-items: center; }
.check input { margin: .23rem 0 0; width: 18px; height: 18px; flex: none; accent-color: var(--purple); }
.check.simple input { margin: 0; }
.check small { display: block; margin-top: .15rem; }
.share { display: flex; align-items: flex-end; gap: .46rem; flex-wrap: wrap; }
.share label { flex: 1 1 16rem; }
.notice { margin: .75rem 0; padding: .68rem .87rem; border: 1px solid; border-radius: 8px; }
.notice.success { color: #175742; background: #e7f7ef; border-color: #a6d8c4; }
.notice.error { color: #86254d; background: #fff0f5; border-color: #e5b5ca; }

@media (max-width: 950px) {
    .app { grid-template-columns: 192px minmax(0, 1fr); }
    .sidebar { padding-inline: .7rem; }
    .brand { gap: .48rem; font-size: .96rem; }
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card-photo { height: clamp(155px, 22vw, 220px); }
}

@media (max-width: 700px) {
    .app { display: block; }
    .sidebar { position: static; height: auto; padding: .67rem .9rem .33rem; border-right: 0; border-bottom: 1px solid var(--line); gap: .6rem; }
    .nav { display: flex; gap: .4rem; }
    .nav a { padding: .53rem .67rem; }
    .nav-label, .sidebar-foot { display: none; }
    .topbar { min-height: 53px; padding: .25rem .95rem; }
    .content { padding: .85rem .9rem 2rem; }
    .hero { min-height: 251px; background-position: 62% center; }
    .hero::before { background: linear-gradient(90deg, #170d2a 6%, #170d2ae8 35%, #170d2aa1 65%, #170d2a66); }
    .hero-content { width: 100%; padding: 1.35rem; }
    .hero p { max-width: 26ch; }
    .roster { margin-top: 1.35rem; }
    .roster-top { align-items: flex-start; }
    .auth { display: block; }
    .auth-form { padding: 2.7rem 0 1.4rem; }
    .auth-art { min-height: 260px; }
}

@media (max-width: 440px) {
    .cards { gap: .64rem; }
    .card-photo { height: 127px; }
    .card-info { padding: .58rem .24rem .36rem; gap: .3rem; align-items: flex-start; }
    .card-info h3 { font-size: 1.02rem; }
    .card-info p { font-size: .85rem; }
    .card-link { display: none; }
    .directory-tools { display: grid; width: 100%; }
    .group-form select { max-width: 100%; }
    .search-form input { flex: 1; }
    .field-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
    .member-card:hover { transform: none; }
}
