/* You're Grounded Adoptions — Public Frontend */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --ink:          #181a15;
    --ink-2:        #28342b;
    --deep:         #090d0c;
    --teal:         #2e4d3f;
    --teal-soft:    #dfe7d7;
    --gold:         #b97934;
    --gold-light:   #d1a263;
    --rose:         #a94f2d;
    --paper:        #f3e7c9;
    --card-bg:      #fffaf0;
    --bg:           #ece3cf;
    --line:         #d8c9a9;
    --line-strong:  #c8b58d;
    --text:         #27251e;
    --text-mid:     #5f5948;
    --text-light:   #817763;
    --error:        #b84a34;
    --success:      #2e6d4d;
    --warning:      #b97934;
    --radius:       8px;
    --radius-sm:    6px;
    --shadow:       0 1px 2px rgba(16,24,39,0.07), 0 10px 28px rgba(16,24,39,0.06);
    --shadow-lg:    0 18px 50px rgba(16,24,39,0.14);
    --navy:         var(--ink);
    --navy-dark:    var(--deep);
    --navy-mid:     var(--ink-2);
    --border:       var(--line);
    --white:        var(--card-bg);
    --cream:        var(--paper);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    color: var(--text);
    line-height: 1.55;
    font-size: 15px;
    background:
        radial-gradient(circle at 20% 0, rgba(185,121,52,0.14), transparent 32rem),
        linear-gradient(180deg, rgba(24,26,21,0.08) 0, rgba(24,26,21,0) 280px),
        linear-gradient(120deg, #efe4cb 0%, #f8f0df 50%, #e5eadc 100%);
}

a { color: inherit; }

/* Navigation */
nav {
    min-height: 66px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(9,13,12,0.95);
    border-bottom: 1px solid rgba(209,162,99,0.28);
    box-shadow: 0 12px 34px rgba(9,13,12,0.2);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
nav .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--paper);
    font-size: 0.98rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}
nav .brand img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(209,162,99,0.7);
    box-shadow: 0 0 0 3px rgba(243,231,201,0.08);
}
nav ul {
    list-style: none;
    display: flex;
    gap: 0.35rem;
    padding: 0.25rem;
    border: 1px solid rgba(243,231,201,0.1);
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
}
nav ul a {
    color: rgba(255,255,255,0.74);
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 600;
    padding: 0.48rem 0.9rem;
    border-radius: 999px;
    transition: background 0.15s, color 0.15s;
}
nav ul a:hover { background: rgba(255,255,255,0.1); color: #fff; }
nav .nav-user {
    color: var(--paper);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.42rem 0.78rem;
    background: rgba(185,121,52,0.16);
    border: 1px solid rgba(209,162,99,0.34);
    border-radius: 999px;
    white-space: nowrap;
}

.container {
    width: min(1160px, calc(100% - 2rem));
    margin: 2rem auto;
}

/* Surfaces */
.card {
    background: rgba(255,250,240,0.96);
    border: 1px solid rgba(200,181,141,0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.65rem;
    margin-bottom: 1.35rem;
}
.card-title {
    color: var(--ink);
    font-size: 1rem;
    font-weight: 700;
    padding-bottom: 0.75rem;
    margin-bottom: 1.1rem;
    border-bottom: 1px solid var(--line);
    position: relative;
}
.card-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 58px;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), var(--teal));
}

/* Browse/profile cards */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    gap: 1.15rem;
}
.profile-card {
    background: var(--card-bg);
    border: 1px solid rgba(200,181,141,0.95);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(16,24,39,0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}
.profile-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(46,77,63,0.48);
}
.profile-card img,
.profile-card .no-photo {
    width: 100%;
    height: 218px;
    display: block;
}
.profile-card img {
    object-fit: cover;
    background: var(--deep);
}
.profile-card .no-photo {
    background:
        linear-gradient(135deg, rgba(46,77,63,0.95), rgba(9,13,12,0.96));
    color: var(--paper);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.2rem;
}
.profile-card .pc-body { padding: 1rem 1.05rem 1.15rem; }
.profile-card .pc-name { font-size: 1.02rem; font-weight: 700; color: var(--ink); margin-bottom: 0.18rem; }
.profile-card .pc-meta { font-size: 0.78rem; color: var(--text-light); }
.profile-card .pc-bio {
    font-size: 0.84rem;
    color: var(--text-mid);
    margin-top: 0.55rem;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Forms */
.form-group { margin-bottom: 1.15rem; }
.form-group label {
    display: block;
    font-size: 0.83rem;
    color: var(--ink);
    font-weight: 700;
    margin-bottom: 0.38rem;
}
.form-group input[type=text],
.form-group input[type=password],
.form-group input[type=email],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.68rem 0.84rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.93rem;
    background: #fff;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    -webkit-appearance: none;
    appearance: none;
}
.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23546172' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.4rem;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(46,77,63,0.14);
    background: var(--paper);
}
.form-group textarea { min-height: 120px; resize: vertical; }
.form-hint { font-size: 0.78rem; color: var(--text-light); margin-top: 0.35rem; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.62rem 1.15rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s, border-color 0.15s;
    line-height: 1.1;
    white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--teal); box-shadow: 0 8px 20px rgba(46,77,63,0.22); }
.btn-gold { background: var(--gold); color: #1e2530; }
.btn-gold:hover { background: var(--gold-light); box-shadow: 0 8px 20px rgba(196,154,70,0.22); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #a83434; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #176a48; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-sm { padding: 0.4rem 0.78rem; font-size: 0.8rem; }

/* Alerts */
.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border: 1px solid;
    box-shadow: 0 1px 2px rgba(16,24,39,0.04);
}
.alert-error   { background: #fff1f1; border-color: #efb4b4; color: #8c2828; }
.alert-success { background: #eef9f3; border-color: #a8dcc2; color: #176a48; }
.alert-info    { background: #edf7f8; border-color: #afd9dc; color: #245f63; }
.alert-warning { background: #fff7e8; border-color: #eccb90; color: #815317; }

.autosave-bar {
    display: flex;
    justify-content: flex-end;
    margin: -0.35rem 0 1rem;
    color: var(--text-light);
    font-size: 0.78rem;
    font-weight: 700;
}
.autosave-ok { color: var(--success); }
.autosave-warn { color: #815317; }
.autosave-error { color: var(--error); }
.draft-restore-alert {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.draft-restore-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Public welcome page */
.welcome-page {
    min-height: calc(100vh - 66px);
}
.welcome-hero {
    min-height: min(680px, calc(100vh - 110px));
    display: flex;
    align-items: center;
    background:
        linear-gradient(90deg, rgba(9,13,12,0.88), rgba(9,13,12,0.62) 50%, rgba(9,13,12,0.32)),
        url("/public/assets/images/youre-grounded-logo.jpeg") center right 12% / min(560px, 58vw) auto no-repeat,
        linear-gradient(135deg, #192a23, #efe4cb);
    border-bottom: 1px solid var(--line-strong);
}
.welcome-copy {
    width: min(1160px, calc(100% - 2rem));
    margin: 0 auto;
    padding: clamp(2.4rem, 7vw, 5.5rem) 0;
    color: var(--paper);
}
.welcome-logo {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(209,162,99,0.8);
    box-shadow: 0 0 0 5px rgba(243,231,201,0.09), 0 18px 40px rgba(0,0,0,0.26);
    margin-bottom: 1.1rem;
}
.welcome-kicker {
    color: var(--gold-light);
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    margin-bottom: 0.75rem;
}
.welcome-copy h1 {
    max-width: 680px;
    font-size: clamp(2.55rem, 7vw, 5.6rem);
    line-height: 0.95;
    letter-spacing: 0;
    margin-bottom: 1.05rem;
}
.welcome-lede {
    max-width: 620px;
    color: rgba(255,250,240,0.86);
    font-size: 1.08rem;
    line-height: 1.75;
}
.welcome-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.6rem;
}
.welcome-outline {
    color: var(--paper);
    border-color: rgba(243,231,201,0.48);
    background: rgba(255,255,255,0.06);
}
.welcome-outline:hover {
    background: var(--paper);
    color: var(--ink);
    border-color: var(--paper);
}
.welcome-band {
    width: min(1160px, calc(100% - 2rem));
    margin: -2.1rem auto 0;
    position: relative;
}
.welcome-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}
.welcome-step {
    background: rgba(255,250,240,0.97);
    border: 1px solid rgba(200,181,141,0.95);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.1rem;
}
.welcome-step span {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--ink);
    color: var(--gold-light);
    font-size: 0.8rem;
    font-weight: 900;
    margin-bottom: 0.85rem;
}
.welcome-step h2 {
    color: var(--ink);
    font-size: 1rem;
    margin-bottom: 0.45rem;
}
.welcome-step p {
    color: var(--text-mid);
    font-size: 0.88rem;
    line-height: 1.62;
}
.welcome-help {
    width: min(1160px, calc(100% - 2rem));
    margin: 1.35rem auto 0;
    padding: 1.35rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255,250,240,0.76);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}
.welcome-help h2 {
    color: var(--ink);
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}
.welcome-help p {
    color: var(--text-mid);
}
.welcome-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 0.8rem;
}

/* Profile layout */
.profile-layout {
    display: grid;
    grid-template-columns: 295px 1fr;
    gap: 1.35rem;
    align-items: start;
}
.profile-sidebar-card {
    background:
        linear-gradient(180deg, rgba(223,189,106,0.13), rgba(223,189,106,0) 42%),
        linear-gradient(145deg, var(--deep), var(--ink-2) 62%, #14383b);
    border: 1px solid rgba(223,189,106,0.23);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 1.65rem 1.35rem;
    text-align: center;
    position: sticky;
    top: 86px;
}
.hero-avatar-wrap {
    width: 164px;
    height: 164px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, var(--gold), var(--teal-soft));
    box-shadow: 0 16px 34px rgba(0,0,0,0.22);
}
.hero-avatar-wrap img,
.hero-avatar-wrap .avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}
.hero-avatar-wrap img { object-fit: cover; display: block; background: var(--deep); }
.hero-avatar-wrap .avatar-placeholder {
    background: var(--deep);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f3d98b;
    font-size: 4rem;
}
.sidebar-name { font-size: 1.28rem; font-weight: 700; color: #fff; margin-bottom: 0.22rem; }
.sidebar-handle { font-size: 0.82rem; color: rgba(243,217,139,0.82); margin-bottom: 0.85rem; }
.sidebar-role {
    display: inline-block;
    padding: 0.3rem 0.78rem;
    border-radius: 999px;
    background: rgba(47,111,115,0.32);
    border: 1px solid rgba(217,238,238,0.28);
    color: #d9eeee;
    font-size: 0.78rem;
    font-weight: 700;
}
.sidebar-cat { font-size: 0.78rem; color: rgba(255,255,255,0.56); margin-top: 0.45rem; margin-bottom: 1.2rem; }
.sidebar-divider { border: none; border-top: 1px solid rgba(223,189,106,0.18); margin: 1.2rem 0; }

.like-btn-primary,
.like-btn-secondary {
    width: 100%;
    padding: 0.72rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.like-btn-primary { background: var(--gold); border: 1px solid transparent; color: #1e2530; }
.like-btn-primary:hover { background: var(--gold-light); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(196,154,70,0.25); }
.like-btn-secondary { background: rgba(168,87,80,0.12); border: 1px solid rgba(239,180,180,0.6); color: #ffd1cd; }
.like-btn-secondary:hover { background: var(--rose); color: #fff; }

.qa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 0.85rem;
    margin-top: 1.15rem;
}
.qa-card {
    background: #f7faf9;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
}
.qa-card .qa-question {
    font-size: 0.7rem;
    color: var(--teal);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}
.qa-card .qa-answer { font-size: 0.9rem; color: var(--text); font-weight: 500; line-height: 1.5; }
.pv-bio { line-height: 1.75; color: var(--text-mid); margin-bottom: 0.5rem; }
.pv-section-title {
    font-size: 0.8rem;
    color: var(--ink);
    font-weight: 800;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.4rem;
    margin: 1.35rem 0 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.album-grid img {
    width: 100%;
    height: 132px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    display: block;
    transition: opacity 0.2s, transform 0.2s;
}
.album-grid a img:hover { opacity: 0.9; transform: scale(1.02); }
.album-grid > div { position: relative; }
.album-grid > div .del-photo { position: absolute; top: 6px; right: 6px; }

/* Public profile showcase */
.profile-backbar { margin-bottom: 1rem; }
.profile-backbar a {
    display: inline-flex;
    align-items: center;
    color: var(--teal);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 800;
}
.profile-backbar a:hover { color: var(--ink); }
.public-profile {
    display: grid;
    gap: 1.25rem;
}
.profile-showcase {
    display: grid;
    grid-template-columns: minmax(280px, 40%) 1fr;
    min-height: 520px;
    border-radius: 18px;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.88), rgba(255,255,255,0.72)),
        linear-gradient(120deg, #f6f0df, #dceff0 52%, #f6e3df);
    border: 1px solid rgba(203,214,221,0.9);
    box-shadow: 0 28px 80px rgba(16,24,39,0.18);
    position: relative;
}
.profile-showcase::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(16,24,39,0.12), rgba(16,24,39,0) 34%),
        repeating-linear-gradient(135deg, rgba(255,255,255,0.22) 0 1px, transparent 1px 18px);
    mix-blend-mode: multiply;
    opacity: 0.45;
}
.profile-media {
    min-height: 520px;
    padding: clamp(1rem, 2.5vw, 1.6rem);
    background:
        radial-gradient(circle at 22% 18%, rgba(223,189,106,0.2), transparent 30%),
        linear-gradient(135deg, var(--deep), #14383b);
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-media img,
.profile-media-empty {
    width: 100%;
    height: min(470px, calc(100% - 1rem));
    max-height: 470px;
    display: block;
    border-radius: 14px;
    position: relative;
    z-index: 1;
}
.profile-media img {
    object-fit: contain;
    background: rgba(255,255,255,0.08);
    box-shadow: 0 18px 44px rgba(0,0,0,0.24);
}
.profile-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(16,24,39,0) 54%, rgba(16,24,39,0.35));
}
.profile-media-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f3d98b;
    font-size: 5rem;
    background: linear-gradient(135deg, var(--teal), var(--deep));
}
.profile-intro {
    position: relative;
    z-index: 1;
    padding: clamp(2rem, 4vw, 4rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.profile-kicker {
    width: fit-content;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(47,111,115,0.12);
    color: var(--teal);
    border: 1px solid rgba(47,111,115,0.24);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}
.profile-intro h1 {
    max-width: 10ch;
    color: var(--ink);
    font-size: clamp(2.6rem, 7vw, 5.7rem);
    line-height: 0.92;
    font-weight: 900;
    margin-bottom: 0.65rem;
}
.profile-handle {
    color: var(--text-mid);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
}
.profile-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 1.35rem;
}
.profile-chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0.36rem 0.8rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.72);
    border: 1px solid rgba(203,214,221,0.9);
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.045em;
}
.profile-chip.primary {
    background: var(--ink);
    color: #f3d98b;
    border-color: var(--ink);
}
.profile-chip.badge-active { background: #dff4e8; color: #176a48; }
.profile-chip.badge-trial,
.profile-chip.badge-in_trial { background: #fff1c8; color: #815317; }
.profile-chip.badge-adopted { background: #deeff0; color: #245f63; }
.profile-chip.badge-blocked { background: #ffe1df; color: #9b332d; }
.profile-stats-row { display: flex; gap: 1.25rem; margin-top: .6rem; }
.profile-stat { font-size: .85rem; color: #888; }
.liker-grid { display: flex; flex-wrap: wrap; gap: .75rem; }
.liker-card { display: flex; flex-direction: column; align-items: center; gap: .35rem; text-decoration: none; color: var(--navy); width: 90px; }
.liker-card:hover .liker-avatar { border-color: var(--gold); }
.liker-avatar { width: 72px; height: 72px; border-radius: 50%; border: 2px solid #ddd; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #f5f2ee; font-size: 1.6rem; }
.liker-avatar img { width: 100%; height: 100%; object-fit: cover; }
.liker-name { font-size: .72rem; text-align: center; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.profile-lede {
    max-width: 62ch;
    color: var(--text);
    font-size: 1.04rem;
    line-height: 1.78;
    background: rgba(255,255,255,0.52);
    border-left: 4px solid var(--gold);
    padding: 1rem 1.1rem;
    border-radius: 0 var(--radius) var(--radius) 0;
}
.profile-lede.muted { color: var(--text-light); font-style: italic; }
.profile-expand-wrap { position: relative; }
.profile-lede.is-collapsed,
.profile-response.is-collapsed {
    max-height: 11.5rem;
    overflow: hidden;
}
.profile-lede.is-collapsed::after,
.profile-response.is-collapsed::after {
    content: "";
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2.2rem;
    height: 3rem;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0.92));
}
.profile-response.is-collapsed::after {
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,248,235,0.94));
}
.profile-answer:nth-child(3n + 2) .profile-response.is-collapsed::after {
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(238,249,249,0.94));
}
.profile-answer:nth-child(3n + 3) .profile-response.is-collapsed::after {
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,241,239,0.94));
}
.profile-lede.is-expanded,
.profile-response.is-expanded {
    max-height: none;
    overflow: visible;
}
.profile-more-button {
    margin-top: 0.55rem;
    border: 0;
    background: transparent;
    color: var(--teal);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 900;
    cursor: pointer;
    padding: 0.15rem 0;
}
.profile-more-button:hover { color: var(--ink); }
.profile-action-area { margin-top: 1.45rem; }
.profile-action-area form { margin: 0; }
.profile-main-action {
    min-width: min(260px, 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 1.25rem;
    border-radius: 999px;
    border: 0;
    background: var(--rose);
    color: #fff;
    text-decoration: none;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(168,87,80,0.28);
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.profile-main-action:hover {
    transform: translateY(-2px);
    background: #913f39;
    box-shadow: 0 18px 40px rgba(168,87,80,0.34);
}
.profile-main-action.secondary {
    background: var(--ink);
    box-shadow: 0 14px 30px rgba(16,24,39,0.24);
}
.profile-note {
    max-width: 420px;
    color: var(--text-mid);
    background: rgba(255,255,255,0.58);
    border: 1px solid rgba(203,214,221,0.9);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    font-weight: 650;
}
.profile-section {
    background: rgba(255,255,255,0.86);
    border: 1px solid rgba(203,214,221,0.9);
    border-radius: 18px;
    padding: clamp(1.25rem, 3vw, 2rem);
    box-shadow: var(--shadow);
}
.profile-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
}
.profile-section-heading span {
    color: var(--ink);
    font-size: clamp(1.35rem, 3vw, 2rem);
    line-height: 1;
    font-weight: 900;
}
.profile-section-heading strong {
    color: var(--teal);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}
.profile-answer-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0.85rem;
}
.profile-answer {
    grid-column: span 4;
    min-height: 150px;
    padding: 1rem;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 1px 2px rgba(16,24,39,0.04);
}
.profile-answer:nth-child(3n + 1) { background: #fff8eb; }
.profile-answer:nth-child(3n + 2) { background: #eef9f9; }
.profile-answer:nth-child(3n + 3) { background: #fff1ef; }
.profile-question {
    color: var(--ink);
    font-size: 0.78rem;
    line-height: 1.35;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.045em;
    margin-bottom: 0.72rem;
}
.profile-response {
    color: var(--text-mid);
    line-height: 1.62;
    font-weight: 550;
}
.profile-photo-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 0.7rem;
}
.profile-photo-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16,24,39,0.05);
    cursor: pointer;
    padding: 0;
}
.profile-photo-strip img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f7faf9;
    display: block;
    transition: transform 0.25s, opacity 0.25s;
}
.profile-photo-thumb:hover img {
    transform: scale(1.03);
    opacity: 0.92;
}
.photo-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(16,24,39,0.84);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.photo-modal.open { display: flex; }
.photo-modal img {
    max-width: min(980px, 92vw);
    max-height: 82vh;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(0,0,0,0.36);
}
.photo-modal-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255,255,255,0.24);
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}
.photo-modal-close:hover { background: rgba(255,255,255,0.22); }
.photo-modal-caption {
    position: fixed;
    left: 2rem;
    bottom: 1.2rem;
    color: rgba(255,255,255,0.72);
    font-size: 0.85rem;
    font-weight: 700;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.22rem 0.68rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge-active     { background: #dff4e8; color: #176a48; }
.badge-in_trial,
.badge-trial      { background: #fff1c8; color: #815317; }
.badge-adopted    { background: #deeff0; color: #245f63; }
.badge-blocked    { background: #ffe1df; color: #9b332d; }
.badge-incomplete,
.badge-expired    { background: #eef2f5; color: #667383; }
.badge-final      { background: #eadff5; color: #6d3f94; }

.cert-box {
    text-align: center;
    padding: 1.8rem;
    border: 1px solid rgba(196,154,70,0.45);
    border-radius: var(--radius);
    background: linear-gradient(135deg, #fffaf0, #f4fbfb);
}
.cert-box img { max-width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-lg); margin-bottom: 1rem; }

.pagination { display: flex; gap: 0.4rem; justify-content: center; margin-top: 1.4rem; flex-wrap: wrap; }
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.7rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 700;
    transition: all 0.15s;
}
.pagination a:hover,
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }

.expired-box {
    max-width: 500px;
    margin: 5rem auto;
    text-align: center;
    padding: 2.6rem 2rem;
    background: rgba(255,255,255,0.96);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
}
.expired-box h1 { color: var(--ink); margin-bottom: 0.75rem; font-size: 1.55rem; font-weight: 800; }
.expired-box p { color: var(--text-mid); line-height: 1.65; }
.expired-box .icon { font-size: 2.6rem; color: var(--gold); margin-bottom: 1rem; display: block; }
.expired-logo {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto 1.2rem;
    border: 1px solid rgba(185,121,52,0.68);
    box-shadow: 0 0 0 6px rgba(185,121,52,0.1);
}

.trial-box {
    background: linear-gradient(135deg, #fff7e8, #edf7f8);
    border: 1px solid rgba(196,154,70,0.5);
    border-radius: var(--radius);
    padding: 1.35rem;
    margin-bottom: 1.35rem;
}
.trial-box h3 { color: var(--ink); margin-bottom: 0.5rem; font-weight: 800; }
.trial-days { font-size: 2.1rem; font-weight: 800; color: var(--teal); }

.cat-tabs,
.container > div[style*="flex-wrap"] {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.cat-tab {
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid var(--line-strong);
    color: var(--text-mid);
    background: #fff;
    transition: all 0.15s;
}
.cat-tab:hover { border-color: var(--teal); color: var(--teal); }
.cat-tab.active { background: var(--ink); color: #f3d98b; border-color: var(--ink); }

/* Browse filter panel */
.filter-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    padding: 0;
}
.filter-summary {
    cursor: pointer;
    font-weight: 600;
    font-size: .9rem;
    color: var(--navy);
    padding: .7rem 1.1rem;
    list-style: none;
    display: flex;
    align-items: center;
    gap: .4rem;
    user-select: none;
}
.filter-summary::-webkit-details-marker { display: none; }
.filter-summary::before { content: '▸'; font-size: .7rem; transition: transform .15s; }
details[open] .filter-summary::before { transform: rotate(90deg); }
.filter-active-dot {
    width: 7px; height: 7px;
    background: var(--gold);
    border-radius: 50%;
    display: inline-block;
}
.filter-form { padding: .25rem 1.1rem 1rem; }
.filter-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: .75rem;
    margin-bottom: .75rem;
}
.filter-field label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: .25rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.filter-field input {
    width: 100%;
    padding: .4rem .6rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: .85rem;
    font-family: inherit;
    background: #fafafa;
    box-sizing: border-box;
}
.filter-field input:focus { outline: none; border-color: var(--teal); background: #fff; }
.filter-actions { display: flex; gap: .5rem; align-items: center; }

/* Staff directory */
.staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
    gap: 1.15rem;
}
.staff-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}
.staff-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: rgba(47,111,115,0.45); }
.staff-card .sc-photo {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--teal), var(--deep));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f3d98b;
    font-size: 3.6rem;
}
.staff-card img.sc-photo { display: block; }
.staff-card .sc-body { padding: 1.1rem; }
.staff-card .sc-name { font-size: 1rem; font-weight: 700; color: var(--ink); margin-bottom: 0.3rem; }
.staff-card .sc-role {
    display: inline-block;
    padding: 0.22rem 0.66rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    margin-bottom: 0.65rem;
}
.staff-card .sc-bio {
    font-size: 0.84rem;
    color: var(--text-mid);
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.staff-card .sc-msg {
    display: block;
    margin-top: 0.9rem;
    text-align: center;
    padding: 0.5rem;
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s;
}
.staff-card .sc-msg:hover { background: var(--teal); }

.text-muted { color: var(--text-light); }
.text-sm { font-size: 0.85rem; }
hr.divider { border: none; border-top: 1px solid var(--line); margin: 1.5rem 0; }

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 0.8rem;
    margin-top: 2rem;
    border-top: 1px solid var(--line);
}

.feedback-widget {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    width: min(420px, calc(100vw - 2rem));
    z-index: 180;
    background: rgba(255,250,240,0.98);
    border: 1px solid rgba(200,181,141,0.95);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 1rem;
}
.feedback-widget[hidden] { display: none; }
.feedback-widget-close {
    position: absolute;
    top: 0.45rem;
    right: 0.55rem;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
}
.feedback-widget-close:hover { background: rgba(24,26,21,0.08); color: var(--ink); }
.feedback-widget-form { display: grid; gap: 0.7rem; }
.feedback-widget-copy { padding-right: 1.6rem; }
.feedback-widget-copy strong {
    display: block;
    color: var(--ink);
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}
.feedback-widget-copy span {
    display: block;
    color: var(--text-mid);
    font-size: 0.82rem;
    line-height: 1.45;
}
.feedback-widget textarea {
    width: 100%;
    min-height: 76px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fffdf8;
    color: var(--text);
    padding: 0.65rem;
    font: inherit;
    font-size: 0.86rem;
}
.feedback-widget-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.feedback-widget-status {
    min-height: 1rem;
    color: var(--text-light);
    font-size: 0.78rem;
}

@media (max-width: 820px) {
    .welcome-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .welcome-help { align-items: flex-start; flex-direction: column; }
    .profile-layout { grid-template-columns: 1fr; }
    .profile-sidebar-card { position: static; }
    .profile-showcase { grid-template-columns: 1fr; min-height: 0; }
    .profile-media,
    .profile-media img,
    .profile-media-empty { min-height: 340px; }
    .profile-media img,
    .profile-media-empty { height: 340px; }
    .profile-intro h1 { max-width: none; }
    .profile-answer { grid-column: span 6; }
}
@media (max-width: 680px) {
    .container { width: min(100% - 1rem, 1160px); margin: 1rem auto; }
    .card { padding: 1.15rem; }
    nav { min-height: auto; padding: 0.8rem 1rem; flex-wrap: wrap; }
    nav ul { order: 3; width: 100%; justify-content: center; }
    nav .nav-user { font-size: 0.74rem; }
    .welcome-hero {
        min-height: auto;
        background:
            linear-gradient(180deg, rgba(9,13,12,0.86), rgba(9,13,12,0.68)),
            url("/public/assets/images/youre-grounded-logo.jpeg") center 1.5rem / 210px auto no-repeat,
            linear-gradient(135deg, #192a23, #efe4cb);
    }
    .welcome-copy { padding: 15.5rem 0 3.8rem; }
    .welcome-logo { display: none; }
    .welcome-copy h1 { font-size: 2.85rem; }
    .welcome-lede { font-size: 0.98rem; }
    .welcome-actions { align-items: stretch; flex-direction: column; }
    .welcome-actions .btn,
    .welcome-help .btn { width: 100%; }
    .welcome-band { margin-top: -1.3rem; }
    .welcome-grid { grid-template-columns: 1fr; }
    .welcome-step { padding: 1rem; }
    .profile-grid { grid-template-columns: 1fr 1fr; gap: 0.8rem; }
    .profile-card img,
    .profile-card .no-photo { height: 170px; }
    .profile-showcase,
    .profile-section { border-radius: 14px; }
    .profile-intro { padding: 1.35rem; }
    .profile-intro h1 { font-size: 2.55rem; }
    .profile-lede { font-size: 0.96rem; }
    .profile-section-heading { display: block; }
    .profile-section-heading strong { display: block; margin-top: 0.35rem; }
    .profile-answer { grid-column: span 12; min-height: 0; }
    .profile-photo-strip { grid-template-columns: repeat(3, 1fr); }
    .photo-modal { padding: 1rem; }
    .feedback-widget {
        right: 0.5rem;
        bottom: 0.5rem;
        width: calc(100vw - 1rem);
        padding: 0.85rem;
    }
}
@media (max-width: 440px) {
    .profile-grid { grid-template-columns: 1fr; }
    .hero-avatar-wrap { width: 140px; height: 140px; }
}
