/* ============================================================
   AI Superpower — Design System v3 ("Air")
   Apple-inspired: typography-led, white space, one accent.
   Used by: index.html, login.html, community.html
   ============================================================ */

:root {
    /* Color */
    --ink: #1d1d1f;
    --ink-2: #6e6e73;
    --ink-3: #86868b;
    --bg: #ffffff;
    --bg-alt: #f5f5f7;
    --hairline: #e8e8ed;
    --accent: #7c3aed;
    --accent-hover: #6d28d9;
    --accent-soft: #f3eefe;
    --grad: linear-gradient(100deg, #7c3aed 0%, #c026d3 55%, #ec4899 100%);
    --danger: #dc2626;
    --ok: #16a34a;

    /* Type */
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
        "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* Shape */
    --r-card: 20px;
    --r-pill: 980px;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.06);
    --shadow-pop: 0 12px 48px rgba(0, 0, 0, 0.12);

    --nav-h: 56px;
    --maxw: 1080px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: clip;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: var(--r-pill);
    font-size: 17px;
    font-weight: 500;
    padding: 12px 26px;
    transition: all 0.18s ease;
    white-space: nowrap;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid #d2d2d7;
}
.btn-ghost:hover { border-color: var(--ink); }
.btn-sm { font-size: 14px; padding: 8px 18px; }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }

.link-arrow {
    color: var(--accent);
    font-size: 17px;
    font-weight: 500;
}
.link-arrow::after { content: " ›"; }
.link-arrow:hover { text-decoration: underline; }

/* ---------- Nav ---------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--nav-h);
    background: rgba(255, 255, 255, 0.78);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.nav-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 28px;
    position: relative;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 600;
    font-size: 17px;
    letter-spacing: -0.01em;
}
.nav-brand img { width: 28px; height: 28px; border-radius: 7px; }
.nav-links {
    display: flex;
    gap: 24px;
    margin-left: auto;
    align-items: center;
}
.nav-links a {
    color: var(--ink-2);
    font-size: 14px;
    transition: color 0.15s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.btn-accent, .nav-links a.btn-accent:hover { color: #fff; }
.nav-cta { margin-left: 4px; }

/* Auth-aware nav slot */
.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--grad);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: none;
    user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }

.menu-pop {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #fff;
    border: 1px solid var(--hairline);
    border-radius: 14px;
    box-shadow: var(--shadow-pop);
    min-width: 200px;
    padding: 6px;
    display: none;
    z-index: 1200;
}
.menu-pop.open { display: block; }
.menu-pop .menu-head {
    padding: 10px 12px;
    border-bottom: 1px solid var(--hairline);
    margin-bottom: 6px;
}
.menu-pop .menu-head strong { display: block; font-size: 14px; }
.menu-pop .menu-head span { font-size: 12px; color: var(--ink-3); word-break: break-all; }
.menu-pop button, .menu-pop a {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 9px 12px;
    font-size: 14px;
    color: var(--ink);
    border-radius: 9px;
}
.menu-pop button:hover, .menu-pop a:hover { background: var(--bg-alt); }
.menu-pop .danger { color: var(--danger); }

/* ============================================================
   LANDING
   ============================================================ */

.hero-air {
    padding: 96px 24px 72px;
    text-align: center;
}
.hero-air .eyebrow {
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.02em;
    margin-bottom: 18px;
}
.hero-air h1 {
    font-size: clamp(2.9rem, 7.5vw, 5.4rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.04;
    max-width: 15ch;
    margin: 0 auto 22px;
}
.hero-air h1 .grad {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.hero-air .sub {
    font-size: clamp(1.1rem, 2.2vw, 1.45rem);
    color: var(--ink-2);
    max-width: 44ch;
    margin: 0 auto 34px;
    line-height: 1.45;
}
.hero-air .cta-row {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}
.hero-air .trust {
    font-size: 14px;
    color: var(--ink-3);
}
.hero-air .trust b { color: var(--ink-2); font-weight: 600; }
.hero-air .trust span { margin: 0 10px; }

/* Sections */
.section { padding: 88px 0; }
.section.alt { background: var(--bg-alt); }
.section-head { text-align: center; margin-bottom: 52px; }
.section-head .kicker {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}
.section-head h2 {
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.1;
}
.section-head p {
    font-size: 19px;
    color: var(--ink-2);
    max-width: 52ch;
    margin: 16px auto 0;
}

/* Community showcase */
.community-panel {
    background: #fff;
    border: 1px solid var(--hairline);
    border-radius: 28px;
    box-shadow: var(--shadow-card);
    padding: 48px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}
.community-panel .points { display: flex; flex-direction: column; gap: 26px; }
.point h3 {
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.point h3 .pt-ic {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex: none;
}
.point p { color: var(--ink-2); font-size: 15px; line-height: 1.55; }

/* Mini feed mock */
.feed-mock {
    background: var(--bg-alt);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.feed-mock .fm-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid var(--hairline);
    padding: 14px 16px;
}
.fm-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.fm-top .who { font-size: 13px; font-weight: 600; }
.fm-top .chip {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: var(--r-pill);
    padding: 3px 10px;
    white-space: nowrap;
}
.fm-body { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.fm-meta { display: flex; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--ink-3); }

/* Event / cohort cards */
.duo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.big-card {
    background: #fff;
    border: 1px solid var(--hairline);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
    padding: 38px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.big-card .tag {
    align-self: flex-start;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 5px 12px;
    border-radius: var(--r-pill);
}
.big-card .tag.live { color: #b91c1c; background: #fee2e2; }
.big-card h3 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.big-card .when { font-size: 15px; color: var(--ink-2); }
.big-card .desc { font-size: 15px; color: var(--ink-2); line-height: 1.55; flex: 1; }
.big-card .card-cta { display: flex; align-items: center; gap: 18px; margin-top: 6px; }

/* Courses grid (restyled for courses.js markup) */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
}
.course-card {
    background: #fff;
    border: 1px solid var(--hairline);
    border-radius: var(--r-card);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); }
.course-image { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.course-card-content { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.course-card-title {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin-bottom: 8px;
}
.course-card-description {
    font-size: 14px;
    color: var(--ink-2);
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 14px;
}
.course-card-meta { display: flex; align-items: center; justify-content: space-between; }
.course-card-cta {
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.course-card-cta:hover { text-decoration: underline; }

.loading-state, .error-state {
    text-align: center;
    color: var(--ink-3);
    padding: 40px 0;
    font-size: 15px;
}

/* All Courses hub (courses.html) */
.catalog-page { padding-top: 64px; }
.catalog-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 30px;
}
.cat-tab {
    padding: 7px 15px;
    border-radius: var(--r-pill);
    border: 1px solid var(--hairline);
    background: var(--bg);
    font-family: var(--font);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-2);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.cat-tab:hover { border-color: var(--ink); color: var(--ink); }
.cat-tab.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.course-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    padding: 4px 11px;
    border-radius: var(--r-pill);
    background: var(--bg-alt);
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 10px;
}
.course-badge i { font-size: 11px; color: var(--accent); }

/* Learning Library (community) */
.library-intro {
    font-size: 14px;
    color: var(--ink-2);
    line-height: 1.55;
    margin-bottom: 14px;
}
.library-search {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-pill);
    font-family: var(--font);
    font-size: 14px;
    color: var(--ink);
    background: var(--bg);
    outline: none;
    margin-bottom: 14px;
}
.library-search:focus { border-color: var(--accent); }
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}
.res-card {
    background: var(--bg);
    border: 1px solid var(--hairline);
    border-radius: var(--r-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.res-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.res-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--bg-alt); }
.res-img-sq { aspect-ratio: 1/1; }
.res-img-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    background: var(--accent-soft);
}
.res-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; gap: 7px; }
.res-type {
    align-self: flex-start;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ink-2);
    background: var(--bg-alt);
    border-radius: var(--r-pill);
    padding: 3px 9px;
}
.res-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.res-take, .res-desc {
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink-2);
}
.res-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* Takeaways are the curation value — never clip them mid-line */
.res-take { color: var(--ink); background: var(--accent-soft); border-radius: 10px; padding: 7px 10px; }
.res-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.res-date { font-size: 12px; color: var(--ink-3); }
.res-cta {
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--accent);
    font-family: var(--font);
    font-size: 13.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
}
.res-cta:hover { text-decoration: underline; }
/* Member-gated resources (communityResources): tag row + accent "Members"
   pill; coming-soon CTA is inert while the linked repo is still private */
.res-tags { display: flex; align-items: center; gap: 6px; }
.res-member {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: var(--r-pill);
    padding: 3px 9px;
}
.res-cta.res-soon { color: var(--ink-3); cursor: default; }
.res-cta.res-soon:hover { text-decoration: none; }
/* Signed-out teaser CTA: the link is locked server-side (guests only get
   the teaser doc, which has no URL) — solid signup pill as the funnel action */
.res-cta.res-locked {
    background: var(--accent);
    color: #fff;
    border-radius: var(--r-pill);
    padding: 6px 13px;
}
.res-cta.res-locked:hover { text-decoration: none; opacity: .88; }
/* .modal.reader-modal beats the base .modal max-width (same-specificity
   .modal rule is declared later in this file and was clamping it to 420px) */
.modal.reader-modal { max-width: 800px; width: 92vw; max-height: 88vh; overflow-y: auto; }
.modal.reader-modal .reader-content p { font-size: 15.5px; max-width: 68ch; }
.reader-content { padding-right: 6px; }
.reader-title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 12px; }
/* Cover image inside the article detail view — click to open zoom lightbox */
.reader-cover {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 16px;
    cursor: zoom-in;
    display: block;
}
.reader-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.reader-tools .reader-lang { margin-bottom: 0; }
.reader-share { display: inline-flex; align-items: center; gap: 6px; }

/* ===== Image Lightbox (article detail image → zoom in/out) ===== */
.img-lightbox {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: none;
    background: rgba(0, 0, 0, 0.92);
    touch-action: none;
    user-select: none;
}
.img-lightbox.open { display: block; }
.img-lightbox__stage { position: absolute; inset: 0; overflow: hidden; cursor: grab; }
.img-lightbox__stage.grabbing { cursor: grabbing; }
.img-lightbox__img {
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: 92vw;
    max-height: 92vh;
    transform: translate(-50%, -50%) scale(1);
    transform-origin: center center;
    transition: transform 0.08s ease-out;
    will-change: transform;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.img-lightbox__toolbar {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
    z-index: 2;
}
.img-lightbox__btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: background 0.15s ease;
}
.img-lightbox__btn:hover { background: rgba(255, 255, 255, 0.28); }
.img-lightbox__hint {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 14px;
    border-radius: 999px;
    pointer-events: none;
}
@media (max-width: 640px) { .img-lightbox__hint { display: none; } }
.reader-content p { font-size: 15px; line-height: 1.7; color: var(--ink); margin-bottom: 12px; }
.reader-comments { margin-top: 4px; }
.reader-comments .rc-title { font-size: 14.5px; font-weight: 700; margin-top: 8px; }
.reader-comments .comments-box { margin-top: 6px; }

/* Trending rail (community) */
.trend-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    width: 100%;
    background: none;
    border: 0;
    padding: 9px 0;
    cursor: pointer;
    text-align: left;
    font-family: var(--font);
}
.trend-item + .trend-item { border-top: 1px solid var(--hairline); }
.trend-item .avatar { flex: none; }
.trend-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.trend-body {
    font-size: 13px;
    color: var(--ink);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.trend-item:hover .trend-body { color: var(--accent); }
.trend-meta { font-size: 11.5px; color: var(--ink-3); }

/* Instructor */
.instructor-wrap {
    display: flex;
    align-items: center;
    gap: 44px;
    max-width: 820px;
    margin: 0 auto;
}
.instructor-wrap img {
    width: 168px;
    height: 168px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
    box-shadow: var(--shadow-card);
}
.instructor-wrap h3 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.instructor-wrap .role { color: var(--accent); font-weight: 600; font-size: 14px; margin-bottom: 12px; }
.instructor-wrap p { color: var(--ink-2); font-size: 16px; line-height: 1.6; margin-bottom: 14px; }
.social-row { display: flex; gap: 14px; }
.social-row a {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 1px solid var(--hairline);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-2);
    font-size: 15px;
    transition: all 0.15s;
}
.social-row a:hover { color: var(--accent); border-color: var(--accent); }

/* Final CTA band */
.cta-band { text-align: center; padding: 100px 24px; }
.cta-band h2 {
    font-size: clamp(2.1rem, 5vw, 3.4rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 14px;
}
.cta-band p { font-size: 19px; color: var(--ink-2); margin-bottom: 30px; }

/* Footer */
.footer-air {
    border-top: 1px solid var(--hairline);
    background: var(--bg-alt);
    padding: 40px 0;
    font-size: 13px;
    color: var(--ink-3);
}
.footer-air .foot-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}
.footer-air a { color: var(--ink-2); }
.footer-air a:hover { color: var(--ink); }
.footer-air .spacer { flex: 1; }

/* ============================================================
   AUTH (login.html)
   ============================================================ */
.auth-wrap {
    min-height: calc(100vh - var(--nav-h));
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 9vh 24px 60px;
    background: var(--bg-alt);
}
.auth-card {
    background: #fff;
    border: 1px solid var(--hairline);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
    width: 100%;
    max-width: 420px;
    padding: 40px 36px 34px;
}
.auth-card .auth-logo { width: 52px; height: 52px; border-radius: 13px; margin: 0 auto 18px; }
.auth-card h1 {
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
    margin-bottom: 6px;
}
.auth-card .auth-sub {
    text-align: center;
    color: var(--ink-2);
    font-size: 14.5px;
    margin-bottom: 26px;
}
.btn-google {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #d2d2d7;
    border-radius: 12px;
    padding: 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--ink);
    transition: all 0.15s;
}
.btn-google:hover { border-color: var(--ink-3); background: #fafafa; }
.btn-google svg { width: 18px; height: 18px; }
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink-3);
    font-size: 12px;
    margin: 20px 0;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select {
    width: 100%;
    border: 1px solid #d2d2d7;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    color: var(--ink);
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}
.auth-submit { width: 100%; border-radius: 12px; padding: 13px; font-size: 16px; }
.auth-alt {
    text-align: center;
    font-size: 13.5px;
    color: var(--ink-2);
    margin-top: 18px;
}
.auth-alt a, .auth-alt button {
    color: var(--accent);
    background: none;
    border: none;
    font-size: 13.5px;
    font-weight: 600;
    padding: 0;
}
.auth-alt a:hover, .auth-alt button:hover { text-decoration: underline; }
.auth-msg {
    display: none;
    font-size: 13.5px;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
    line-height: 1.45;
}
.auth-msg.err { display: block; background: #fef2f2; color: #b91c1c; }
.auth-msg.ok { display: block; background: #f0fdf4; color: #15803d; }
.auth-fineprint {
    text-align: center;
    font-size: 11.5px;
    color: var(--ink-3);
    margin-top: 20px;
    line-height: 1.5;
}

/* ============================================================
   COMMUNITY APP (community.html)
   ============================================================ */
.app-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 24px 80px;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 264px;
    gap: 32px;
    align-items: start;
}

/* Sidebar — spaces
   Sticky + own scroll area: the wheel scrolls the column under the cursor,
   not the page, so long sidebars are reachable without scrolling the feed. */
.spaces-nav {
    position: sticky;
    top: calc(var(--nav-h) + 24px);
    /* --jb-h = height of the fixed signed-out join banner (set by community.js),
       so the column's own scroll covers the part the banner hides */
    max-height: calc(100vh - var(--nav-h) - 48px - var(--jb-h, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-right: 4px;
}

/* Thin scrollbars on the side columns, visible only while hovering */
.spaces-nav, .rail { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.spaces-nav:hover, .rail:hover { scrollbar-color: rgba(0, 0, 0, .22) transparent; }
.spaces-nav::-webkit-scrollbar, .rail::-webkit-scrollbar { width: 5px; }
.spaces-nav::-webkit-scrollbar-track, .rail::-webkit-scrollbar-track { background: transparent; }
.spaces-nav::-webkit-scrollbar-thumb, .rail::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
.spaces-nav:hover::-webkit-scrollbar-thumb, .rail:hover::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, .18); }
.spaces-nav .group-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--ink-3);
    padding: 16px 12px 6px;
}
.space-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 14px;
    color: var(--ink-2);
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    transition: background 0.12s, color 0.12s;
}
.space-link:hover { background: var(--bg-alt); color: var(--ink); }
.space-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.space-link .sp-ic { width: 20px; text-align: center; flex: none; }
.space-link .cnt { margin-left: auto; font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
.space-link .sp-lock { margin-left: 6px; font-size: 11px; opacity: .55; }

/* Sub-tabs nested under an active resource space (filters live in the sidebar) */
.space-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: left;
    padding: 5px 12px 5px 42px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--ink-2);
    background: none;
    border: none;
    transition: background 0.12s, color 0.12s;
}
.space-sub:hover { background: var(--bg-alt); color: var(--ink); }
.space-sub.active { color: var(--accent); font-weight: 600; }
.space-sub .cnt { margin-left: auto; font-size: 11.5px; color: var(--ink-3); }

/* Feed column */
.feed-col { display: flex; flex-direction: column; gap: 18px; }

.feed-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.feed-title small { display: block; font-size: 13.5px; font-weight: 400; color: var(--ink-2); margin-top: 2px; }
/* Copy/share the current tab's link, right beside its title */
.feed-title .title-share {
    display: inline-flex; align-items: center; justify-content: center;
    margin-left: 8px; padding: 4px 8px; border: none; border-radius: 8px;
    background: none; color: var(--ink-3); font-size: 14px; cursor: pointer;
    vertical-align: 2px; transition: background .15s, color .15s;
}
.feed-title .title-share:hover { background: var(--accent-soft); color: var(--accent); }

/* Composer */
.composer {
    background: #fff;
    border: 1px solid var(--hairline);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
    padding: 16px 18px;
}
.composer .comp-row { display: flex; gap: 12px; }
.composer textarea {
    flex: 1;
    border: none;
    resize: none;
    font-family: inherit;
    font-size: 15px;
    color: var(--ink);
    outline: none;
    min-height: 44px;
    padding-top: 8px;
    background: transparent;
}
.composer .comp-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--hairline);
}
.composer select {
    border: 1px solid var(--hairline);
    border-radius: var(--r-pill);
    padding: 7px 14px;
    font-size: 13px;
    font-family: inherit;
    color: var(--ink-2);
    background: #fff;
    outline: none;
}
.composer .comp-foot .btn { margin-left: auto; }

/* Verify-email prompt (shown in place of the composer for unverified members) */
.verify-notice {
    background: var(--accent-soft);
    border: 1px solid var(--hairline);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
    padding: 16px 18px;
    margin-bottom: 16px;
}
.verify-notice .vn-row { display: flex; gap: 12px; align-items: flex-start; }
.verify-notice .vn-icon { font-size: 22px; line-height: 1.2; }
.verify-notice .vn-text { display: flex; flex-direction: column; gap: 3px; }
.verify-notice .vn-text strong { font-size: 15px; color: var(--ink); }
.verify-notice .vn-text span { font-size: 13px; color: var(--ink-2); }
.verify-notice .vn-actions { display: flex; gap: 10px; margin-top: 12px; }
.comment-verify-hint { font-size: 13px; color: var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; }
/* The photo variant is a button (opens the avatar picker) — strip the UA chrome */
button.comment-verify-hint { border: 0; width: 100%; text-align: left; cursor: pointer; font: inherit; font-size: 13px; }

/* Post cards */
.post-card {
    background: #fff;
    border: 1px solid var(--hairline);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
    padding: 20px 22px;
}
.post-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.post-head .who { line-height: 1.25; }
.post-head .who .name { font-size: 14.5px; font-weight: 600; }
.post-head .who .time { font-size: 12.5px; color: var(--ink-3); }
.post-head .chip {
    margin-left: auto;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: var(--r-pill);
    padding: 4px 12px;
    white-space: nowrap;
}
.lang-toggle {
    display: inline-flex;
    border: 1px solid var(--line, #e2e2ea);
    border-radius: var(--r-pill);
    overflow: hidden;
    cursor: pointer;
    background: transparent;
    padding: 0;
    flex-shrink: 0;
}
.lang-toggle span {
    padding: 5px 11px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-3);
    line-height: 1;
}
.lang-toggle span.active {
    background: var(--accent-soft);
    color: var(--accent);
}
.post-head .pin-badge {
    margin-left: auto;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ink-3);
    white-space: nowrap;
}
.post-head .pin-badge + .chip { margin-left: 0; }
.post-body {
    font-size: 15px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 12px;
}
/* Long posts collapse to ~8 lines behind a "Read more" toggle so the feed stays
   scannable. The toggle is injected by clampBodies() in community.js and ONLY
   when the body actually overflows — short posts render exactly as before. */
.post-body.clamped {
    max-height: 12.8em;          /* 8 lines at font-size 15px / line-height 1.6 */
    overflow: hidden;
    /* Fades the last two lines so it reads as "continues" rather than a hard cut.
       Unsupported browsers just get the clean cut — degrades fine. */
    -webkit-mask-image: linear-gradient(to bottom, #000 9.6em, transparent 12.8em);
    mask-image: linear-gradient(to bottom, #000 9.6em, transparent 12.8em);
}
.read-more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 0;
    padding: 0;
    margin: -6px 0 12px;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
}
.read-more:hover { color: var(--accent-hover); text-decoration: underline; }
.read-more::after {
    content: '';
    width: 0; height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
}
.read-more[data-state="expanded"]::after { transform: rotate(180deg); }

/* Auto-linked URLs in post/comment bodies (see linkify() in community.js) */
.post-body a.post-link,
.comment-bubble .c-body a.post-link {
    color: var(--accent);
    text-decoration: underline;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.post-body a.post-link:hover,
.comment-bubble .c-body a.post-link:hover { color: var(--accent-hover); }
.post-actions { display: flex; align-items: center; gap: 6px; }
.pa-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: none;
    border: none;
    border-radius: var(--r-pill);
    padding: 7px 14px;
    font-size: 13.5px;
    color: var(--ink-2);
    transition: background 0.12s, color 0.12s;
}
.pa-btn:hover { background: var(--bg-alt); color: var(--ink); }
.pa-btn.liked { color: #e11d48; font-weight: 600; }
.pa-btn.del { margin-left: auto; color: var(--ink-3); }
.pa-btn.del:hover { color: var(--danger); background: #fef2f2; }

/* Comments */
.comments-box { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hairline); }
.comment-row { display: flex; gap: 10px; margin-bottom: 12px; }
.comment-bubble {
    background: var(--bg-alt);
    border-radius: 14px;
    padding: 9px 14px;
    flex: 1;
    min-width: 0;
}
.comment-bubble .c-name { font-size: 12.5px; font-weight: 600; }
.c-name-link { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; vertical-align: baseline; }
.c-name-link:hover { text-decoration: underline; }
.comment-bubble .c-body { font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.comment-bubble .c-time { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.comment-del {
    background: none; border: none; color: var(--ink-3);
    font-size: 12px; align-self: center; padding: 4px 6px; border-radius: 6px;
}
.comment-del:hover { color: var(--danger); }
.comment-reply {
    background: none; border: none; color: var(--ink-3);
    font-size: 11px; font-weight: 600; padding: 0; cursor: pointer;
}
.comment-reply:hover { color: var(--accent); }
.c-mention { color: var(--accent); font-weight: 600; }
.comment-form { display: flex; gap: 10px; align-items: center; }
.comment-form input {
    flex: 1;
    border: 1px solid var(--hairline);
    border-radius: var(--r-pill);
    padding: 9px 16px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
}
.comment-form input:focus { border-color: var(--accent); }

/* Right rail */
.rail {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: calc(var(--nav-h) + 24px);
    max-height: calc(100vh - var(--nav-h) - 48px - var(--jb-h, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 2px 4px 12px 2px;   /* room for card shadows + the hover scrollbar */
}
.rail-card {
    background: #fff;
    border: 1px solid var(--hairline);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
    padding: 20px;
}
.rail-card h4 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 8px; }
.rail-card p { font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.rail-card .rail-cta { margin-top: 12px; }
.me-card { display: flex; align-items: center; gap: 12px; }
.me-card .me-info { min-width: 0; }
.me-card .me-info .name { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-card .me-info button {
    background: none; border: none; padding: 0;
    color: var(--accent); font-size: 12.5px; font-weight: 600;
}
.me-card .me-info button:hover { text-decoration: underline; }
.rail-bio { font-size: 12.5px; color: var(--ink-2); margin-top: 10px; line-height: 1.5; }

/* Signed-out join banner */
/* Page content scrolls clear of the fixed banner */
body { padding-bottom: var(--jb-h, 0px); }

.join-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--hairline);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}
.join-banner .jb-text { font-size: 15px; font-weight: 500; }

/* Empty / loading feed states */
.feed-empty {
    text-align: center;
    color: var(--ink-3);
    padding: 60px 20px;
    font-size: 15px;
    background: var(--bg-alt);
    border-radius: var(--r-card);
}

/* Modal (profile edit) */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--shadow-pop);
    width: 100%;
    max-width: 420px;
    padding: 28px;
}
.modal h3 { font-size: 19px; font-weight: 700; margin-bottom: 18px; letter-spacing: -0.01em; }
.modal .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* Toast */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--ink);
    color: #fff;
    font-size: 14px;
    padding: 11px 22px;
    border-radius: var(--r-pill);
    box-shadow: var(--shadow-pop);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    z-index: 2000;
    max-width: 90vw;
    text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .app-shell { grid-template-columns: 200px minmax(0, 1fr); }
    .rail { display: none; }
}

@media (max-width: 768px) {
    .nav-links a.nav-hide-m { display: none; }
    .hero-air { padding: 64px 20px 52px; }
    .section { padding: 60px 0; }
    .community-panel { grid-template-columns: 1fr; padding: 28px; gap: 30px; }
    .duo-grid { grid-template-columns: 1fr; }
    .instructor-wrap { flex-direction: column; text-align: center; }
    .instructor-wrap .social-row { justify-content: center; }
    /* minmax(0,1fr) + min-width:0 — a plain 1fr lets wide intrinsic content
       (composer select row, post chips) blow the column past the viewport,
       and body's overflow-x:clip then silently cuts off the right edge */
    .app-shell {
        grid-template-columns: minmax(0, 1fr);
        padding: 16px 14px 90px;
        gap: 14px;
    }
    .feed-col { min-width: 0; }
    .spaces-nav {
        position: static;
        flex-direction: row;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 8px;
        /* bleed to the screen edges so the pill row scrolls edge-to-edge */
        margin: 0 -14px;
        padding: 0 14px 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .spaces-nav::-webkit-scrollbar { display: none; }
    .spaces-nav .group-label { display: none; }
    .space-link { white-space: nowrap; width: auto; border: 1px solid var(--hairline); border-radius: var(--r-pill); padding: 7px 14px; }
    .space-link.active { border-color: transparent; }
    /* Sub-tabs join the horizontal pill row on mobile */
    .space-sub { white-space: nowrap; width: auto; border: 1px dashed var(--hairline); border-radius: var(--r-pill); padding: 7px 12px; }
    .space-sub .cnt { margin-left: 6px; }
    .space-link .cnt { margin-left: 6px; }
    .auth-card { padding: 30px 22px 26px; }
}

/* ---------- Phone (≤640px): compact header, touch-friendly feed ---------- */
@media (max-width: 640px) {
    /* Header: icon-only brand so avatar/auth + audio pill + language toggle
       all fit in one 56px row (brand text was wrapping and pushing the
       toggle off-screen) */
    .nav-inner { gap: 10px; padding: 0 14px; }
    .nav-brand { font-size: 0; gap: 0; flex: none; }
    .nav-brand img { width: 32px; height: 32px; }
    .nav-links { gap: 10px; }
    .nav-links a { white-space: nowrap; }
    .nav-links a.btn { font-size: 13px; padding: 8px 14px; }
    .nav-cta { margin-left: 0; }
    .lang-toggle span { padding: 5px 9px; font-size: 12px; }

    /* Feed: lighter card chrome, comfortable tap targets (≈44px) */
    .feed-title { font-size: 20px; }
    .post-card { padding: 16px; border-radius: 16px; }
    .post-head { flex-wrap: nowrap; }
    .post-head .chip {
        max-width: 44%; overflow: hidden; text-overflow: ellipsis;
        font-size: 11px; padding: 3px 9px;
    }
    .pa-btn { padding: 10px 12px; }

    /* Composer: the space select shrinks instead of pushing Post off-screen */
    .composer { padding: 12px 14px; }
    .composer .comp-foot { gap: 8px; }
    .composer select { flex: 1 1 auto; min-width: 0; max-width: 60%; padding: 8px 12px; }

    /* 16px inputs stop iOS Safari's focus auto-zoom */
    .composer textarea, .comment-form input, .dm-composer textarea { font-size: 16px; }

    /* Signed-out join banner: compact + safe-area aware */
    .join-banner { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); gap: 10px; }
    .join-banner .jb-text { font-size: 13.5px; }

    /* Modals hug small screens */
    .modal-overlay { padding: 14px; }
    .modal { padding: 22px 18px; }
}

/* ===== Community v1.1: notifications, post images, member profiles ===== */

.feed-head-row { display: flex; align-items: center; justify-content: space-between; }

.bell-wrap { position: relative; }
.bell-btn {
    position: relative;
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1px solid var(--hairline);
    background: var(--bg);
    color: var(--ink-2);
    font-size: 16px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.bell-btn:hover { background: var(--accent-soft); color: var(--accent); }
.bell-badge {
    position: absolute; top: -4px; right: -4px;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px;
    background: var(--danger); color: #fff;
    font-size: 11px; font-weight: 700; line-height: 18px;
    text-align: center;
}
.notif-panel {
    position: absolute; right: 0; top: 48px;
    width: 340px; max-width: calc(100vw - 40px);
    max-height: 420px; overflow-y: auto;
    background: var(--bg);
    border: 1px solid var(--hairline);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .12);
    padding: 8px;
    z-index: 60;
}
.notif-head { font-size: 13px; font-weight: 700; color: var(--ink-2); padding: 8px 10px 6px; }
.notif-empty { font-size: 13px; color: var(--ink-3); padding: 14px 10px 16px; }
.notif-item {
    display: flex; gap: 10px; align-items: flex-start;
    width: 100%; text-align: left;
    background: none; border: none; cursor: pointer;
    padding: 10px; border-radius: 12px;
    font-family: inherit;
}
.notif-item:hover { background: var(--bg-alt); }
.notif-item.unread { background: var(--accent-soft); }
.notif-item.unread:hover { background: #eae0fd; }
.notif-item .n-text { font-size: 13px; color: var(--ink); line-height: 1.45; }
.notif-item .n-text b { font-weight: 650; }
.notif-item .n-excerpt { color: var(--ink-3); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.notif-item .n-time { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

.comp-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.composer .comp-foot .comp-actions .btn { margin-left: 0; }
.comp-img-preview {
    position: relative;
    margin: 10px 0 2px 44px;
    display: inline-block;
}
.comp-img-preview img {
    max-width: 220px; max-height: 160px;
    border-radius: 12px;
    border: 1px solid var(--hairline);
    display: block;
}
.comp-img-preview button {
    position: absolute; top: -8px; right: -8px;
    width: 24px; height: 24px; border-radius: 50%;
    border: none; background: var(--ink); color: #fff;
    font-size: 12px; cursor: pointer;
}

.post-img {
    display: block;
    max-width: 100%; max-height: 420px;
    border-radius: 14px;
    border: 1px solid var(--hairline);
    margin: 10px 0 2px;
    cursor: zoom-in;
    object-fit: cover;
}

.post-video {
    width: 100%;
    cursor: default;
    object-fit: contain;
    background: #000;
}

.lightbox {
    position: fixed; inset: 0;
    display: none;
    align-items: center; justify-content: center;
    background: rgba(0, 0, 0, .82);
    z-index: 120;
    cursor: zoom-out;
    padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

.author-link { display: flex; gap: inherit; align-items: center; background: none; border: none; padding: 0; cursor: pointer; font-family: inherit; text-align: left; }
.author-link:hover .name { text-decoration: underline; }

.member-modal { width: 420px; }
.mm-head { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.mm-head .name { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.mm-head .meta { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.mm-role {
    display: inline-block; margin-left: 8px;
    font-size: 11px; font-weight: 700; color: var(--accent);
    background: var(--accent-soft);
    border-radius: 20px; padding: 2px 9px;
    vertical-align: 2px;
}
.mm-bio { font-size: 14px; color: var(--ink-2); line-height: 1.6; margin: 10px 0 4px; }
.mm-section { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin: 16px 0 8px; }
.mm-post {
    display: block; width: 100%; text-align: left;
    background: var(--bg-alt); border: none; cursor: pointer;
    border-radius: 12px; padding: 10px 12px; margin-bottom: 8px;
    font-family: inherit;
}
.mm-post:hover { background: var(--accent-soft); }
.mm-post .b { font-size: 13.5px; color: var(--ink); line-height: 1.45; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-post .m { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.mm-empty { font-size: 13px; color: var(--ink-3); padding: 4px 0 8px; }

.post-flash { animation: postFlash 1.6s ease; }
@keyframes postFlash {
    0% { box-shadow: 0 0 0 3px var(--accent); }
    100% { box-shadow: 0 0 0 3px transparent; }
}
/* cued (shared) Daily Audio episode reuses the same highlight */
.da-row.da-flash { animation: postFlash 1.6s ease; }

/* ---------- Share popover ---------- */
.share-pop {
    position: absolute; z-index: 1200;
    background: var(--bg); border: 1px solid var(--hairline);
    border-radius: 14px; box-shadow: var(--shadow-pop);
    padding: 8px; min-width: 224px; max-width: 90vw;
    max-height: calc(100vh - 16px); overflow-y: auto;  /* never taller than the screen */
}
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.share-opt {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 10px 12px; border: none; background: none; cursor: pointer;
    border-radius: 10px; font-size: 13.5px; font-family: inherit;
    color: var(--ink); text-align: left; width: 100%;
}
.share-opt i { width: 18px; text-align: center; font-size: 15px; color: var(--ink-2); }
.share-opt:hover { background: var(--bg-alt); }
.share-opt:hover i { color: var(--accent); }
.share-qr { margin-top: 6px; padding: 12px 8px 8px; border-top: 1px solid var(--hairline); text-align: center; }
.share-qr-box {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 168px; min-height: 168px; color: var(--ink-3);
}
.share-qr-box img, .share-qr-box canvas { display: block; }
.share-qr-hint { margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
/* Branded 朋友圈 share card (pre-generated poster) */
.share-card { margin-top: 6px; padding: 12px 8px 8px; border-top: 1px solid var(--hairline); text-align: center; }
.share-card-img {
    display: block; width: 200px; max-width: 100%; height: auto; margin: 0 auto;
    border-radius: 12px; box-shadow: var(--shadow-pop); background: var(--bg-alt);
}
.share-card-hint { margin: 10px 0; font-size: 12.5px; color: var(--ink-2); }
.share-card-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 11px 14px; border: none; border-radius: 10px; cursor: pointer;
    background: var(--accent); color: #fff; font-family: inherit; font-size: 14px; font-weight: 600;
}
.share-card-btn:hover { filter: brightness(1.05); }
/* Card variant → centered, height-capped, scrollable modal on ALL viewports, so a
   tall poster preview never clips off-screen (regardless of where the button sits). */
.share-pop--card {
    position: fixed !important; left: 50% !important; top: 50% !important;
    transform: translate(-50%, -50%); width: 320px; max-width: 92vw;
    max-height: calc(100vh - 24px); overflow-y: auto;
}
.share-pop--card .share-card-img { width: 240px; }
/* On phones, center every popover as a sheet so the QR/card always fits */
@media (max-width: 720px) {
    .share-pop {
        position: fixed !important; left: 50% !important; top: 50% !important;
        transform: translate(-50%, -50%); max-height: calc(100vh - 24px); overflow-y: auto; min-width: 260px;
    }
    .share-card-img { width: 240px; }
}
/* Daily Audio share affordances (hero button + per-row icon) */
.da-share {
    width: 32px; height: 32px; border: 1px solid var(--hairline); border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg); color: var(--ink-2); font-size: 13px; cursor: pointer; font-family: inherit;
}
.da-share:hover { border-color: var(--accent); color: var(--accent); }
.da-row-share {
    margin-left: auto; flex: none; width: 30px; height: 30px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--ink-3); font-size: 13px; cursor: pointer;
}
.da-row-share:hover { background: var(--bg); color: var(--accent); }

.translate-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    background: none; border: none; padding: 0;
    margin: 6px 0 2px;
    font-family: inherit; font-size: 12.5px; font-weight: 600;
    color: var(--accent); cursor: pointer;
}
.translate-toggle:hover { text-decoration: underline; }

/* ---------- Cohort fit finder (landing) ---------- */
.fit-wrap {
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.fit-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
.fit-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--r-pill);
    border: 1px solid var(--hairline);
    background: #fff;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink-2);
    transition: all .25s ease;
}
.fit-tab:hover { border-color: var(--accent); color: var(--ink); transform: translateY(-1px); }
.fit-tab.active {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
    box-shadow: var(--shadow-card);
}
.fit-ic { font-size: 18px; }
.fit-panel {
    background: #fff;
    border: 1px solid var(--hairline);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
    padding: 34px 38px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.fit-panel.fit-in { animation: fitIn .45s cubic-bezier(.2,.7,.3,1) both; }
@keyframes fitIn {
    from { opacity: 0; transform: translateY(14px) scale(.99); }
    to   { opacity: 1; transform: none; }
}
.fit-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 6px;
}
.fit-block p { font-size: 16px; color: var(--ink-2); }
.fit-proof {
    background: var(--accent-soft);
    border-radius: 14px;
    padding: 20px 22px;
}
.fit-proof p { font-size: 15px; color: var(--ink); font-style: italic; }
.fit-proof-by { margin-top: 10px; font-size: 13px; color: var(--ink-3); }
.fit-panel .btn { align-self: flex-start; }

/* ---------- Reviews wall (landing) ---------- */
.rate-badge {
    display: inline-block;
    background: var(--grad);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    font-style: normal;
    padding: 2px 9px;
    border-radius: var(--r-pill);
    vertical-align: 1px;
}
.rate-badge.sm { font-size: 11px; padding: 1px 7px; }
.rev-stars { color: #f5a623; font-size: 14px; letter-spacing: 2px; margin-bottom: 12px; }
.rev-featured {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-bottom: 40px;
}
.rev-feat {
    background: #fff;
    border: 1px solid var(--hairline);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
    padding: 30px 32px;
    display: flex;
    flex-direction: column;
}
.rev-feat .rev-quote { font-size: 15.5px; color: var(--ink); flex: 1; }
.rev-feat-by {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    font-size: 13.5px;
    color: var(--ink-2);
    line-height: 1.35;
}
.rev-feat-by img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}
.rev-feat-by b { color: var(--ink); }

/* Marquee */
.marquee {
    overflow: hidden;
    margin-top: 8px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee-track {
    display: flex;
    gap: 18px;
    width: max-content;
    padding: 6px 0 14px;
    animation: marquee 55s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
.rev-card {
    width: 360px;
    flex: none;
    background: #fff;
    border: 1px solid var(--hairline);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
    padding: 24px 26px;
}
.rev-card .rev-quote { font-size: 14px; color: var(--ink-2); }
.rev-by { margin-top: 14px; font-size: 12.5px; color: var(--ink-3); }

/* Scroll-in */
.fade-up { opacity: 0; transform: translateY(18px); transition: opacity .6s ease var(--d, 0ms), transform .6s ease var(--d, 0ms); }
.fade-up.in { opacity: 1; transform: none; }

@media (max-width: 760px) {
    .rev-featured { grid-template-columns: 1fr; }
    .fit-panel { padding: 26px 22px; }
    .rev-card { width: 300px; }
}
@media (prefers-reduced-motion: reduce) {
    .marquee-track { animation: none; flex-wrap: wrap; width: auto; }
    .fit-panel.fit-in { animation: none; }
    .fade-up { opacity: 1; transform: none; transition: none; }
}

/* ---------- AI Talks (community resource tab) ---------- */
a.talk-card { color: inherit; display: flex; flex-direction: column; }
a.talk-card:hover { text-decoration: none; }
.talk-thumb { position: relative; display: block; }
.talk-thumb .res-img { margin: 0; }
.talk-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    background: rgba(0, 0, 0, 0);
    opacity: 0;
    transition: all .25s ease;
}
.talk-play i {
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(4px);
    padding-left: 4px;
}
.talk-card:hover .talk-play { opacity: 1; background: rgba(0, 0, 0, .12); }
.talk-dur {
    position: absolute;
    right: 10px; bottom: 10px;
    background: rgba(0, 0, 0, .75);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 6px;
}
.talk-card .res-cta { pointer-events: none; }
.talk-share {
    position: absolute;
    top: 10px; right: 10px;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    opacity: 0;
    transition: opacity .2s ease, background .2s ease;
}
.talk-card:hover .talk-share, .talk-share:focus-visible { opacity: 1; }
.talk-share:hover { background: var(--accent); }
@media (hover: none) { .talk-share { opacity: 1; } }

/* ============ Gamification (levels / XP / gold / store) ============ */

.lv-chip {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: var(--r-pill);
    vertical-align: 1px;
    white-space: nowrap;
}
.lv-chip:empty { display: none; }
.lv-star { margin-left: 3px; font-size: 12px; }

/* Contributor badge — hand-picked members who answer and write */
.cb-badge { margin-left: 5px; font-size: 13px; vertical-align: 1px; cursor: default; }
.mm-contrib { font-size: 12px; font-weight: 700; color: var(--accent); margin-top: 2px; }

/* Contributor track — submit → edit → publish → author shares */
.cb-card { background: linear-gradient(160deg, #fff6ec 0%, #fff 55%); }
.cb-note { font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.cb-live { font-size: 13px; font-weight: 700; color: var(--accent); line-height: 1.55; }
.cb-wide { width: 100%; margin-top: 12px; }
.contrib-modal { max-width: 620px; max-height: 88vh; overflow-y: auto; }
.contrib-modal .cb-sub { font-size: 13px; color: var(--ink-2); line-height: 1.6; margin: -8px 0 18px; }
.cb-count { font-size: 12px; color: var(--ink-3); margin-top: 6px; text-align: right; }
.cb-count.short { color: var(--accent); font-weight: 600; }
.cb-urlrow { display: flex; gap: 8px; align-items: center; margin-bottom: 18px; }
.cb-urlrow input {
    flex: 1; min-width: 0;
    border: 1px solid #d2d2d7; border-radius: 12px;
    padding: 10px 12px; font-size: 13px; font-family: inherit;
    color: var(--ink-2); background: var(--bg-alt); outline: none;
}
/* One block per network: the author copies and pastes, nothing to write */
.cb-kit { border: 1px solid var(--hairline); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.cb-kit-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.cb-kit-head span { font-size: 13px; font-weight: 700; }
.cb-kit textarea {
    width: 100%; border: 0; padding: 0; resize: vertical; outline: none;
    font-family: inherit; font-size: 13px; line-height: 1.6;
    color: var(--ink-2); background: transparent;
}

.gm-card { background: linear-gradient(160deg, #faf7ff 0%, #fff 55%); }
.gm-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.gm-ic { font-size: 40px; line-height: 1; }
.gm-head-txt { flex: 1; min-width: 0; }
.gm-lv { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.gm-xpbar {
    height: 8px;
    background: var(--hairline);
    border-radius: var(--r-pill);
    overflow: hidden;
    margin: 6px 0 4px;
}
.gm-xpbar i {
    display: block; height: 100%;
    background: var(--grad);
    border-radius: var(--r-pill);
    transition: width .6s cubic-bezier(.22, 1, .36, 1);
}
.gm-next { font-size: 12px; color: var(--ink-3); }
.gm-stats {
    display: flex; gap: 10px; flex-wrap: wrap;
    font-size: 13px; font-weight: 700;
    padding: 8px 0 4px;
    border-bottom: 1px solid var(--hairline);
    margin-bottom: 6px;
}
.gm-q-title {
    font-size: 12px; font-weight: 700;
    color: var(--ink-3);
    text-transform: uppercase; letter-spacing: .04em;
    margin: 10px 0 4px;
}
.gm-quest {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px;
    padding: 4px 0;
}
.gm-quest.done .gm-q-label { color: var(--ink-3); text-decoration: line-through; }
.gm-q-label { flex: 1; min-width: 0; }
.gm-q-n { font-size: 12px; font-weight: 700; color: var(--accent); }
.gm-store-btn { width: 100%; margin-top: 12px; }

.gm-leader { display: flex; align-items: center; gap: 8px; padding: 5px 6px; margin: 0 -6px; font-size: 13px; cursor: pointer; border-radius: 9px; transition: background .12s ease; }
.gm-leader:hover { background: rgba(124, 58, 237, 0.06); }
.gm-leader:hover .gm-l-name { color: var(--accent); }
.gm-rank { width: 22px; text-align: center; font-weight: 700; }
.gm-l-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.gm-l-lv { font-size: 12px; font-weight: 700; color: var(--ink-2); }

.store-modal { max-width: 480px; }
.gm-balance { font-size: 14px; margin-bottom: 12px; }
.gm-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px;
    border: 1px solid var(--hairline);
    border-radius: 14px;
    margin-bottom: 8px;
}
.gm-item-ic { font-size: 26px; }
.gm-item-txt { flex: 1; min-width: 0; }
.gm-item-name { font-size: 14px; font-weight: 700; }
.gm-item-d { font-size: 12px; color: var(--ink-3); }
.gm-item button { white-space: nowrap; }
.gm-order {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px solid var(--hairline);
}
.gm-status { font-size: 12px; font-weight: 700; }
.gm-status.pending { color: #b45309; }
.gm-status.fulfilled { color: var(--ok); }
.gm-status.cancelled { color: var(--ink-3); }
.gm-status.approved { color: var(--ok); }
.gm-status.rejected { color: var(--ink-3); }

/* Cohort scholarship seat — the premium, aspirational store item */
.gm-item.gm-seat {
    border: 1px solid var(--accent);
    background: var(--accent-soft);
}
.gm-seat-link {
    display: inline-block; margin-top: 4px;
    font-size: 12px; font-weight: 600; color: var(--accent);
}
.gm-seat-gold { font-weight: 700; color: var(--ok); }
.gm-seat-gold.low { color: #b45309; }

.levelup-modal { max-width: 360px; text-align: center; }
.levelup-icon { font-size: 72px; line-height: 1.1; animation: gm-pop .5s cubic-bezier(.22, 1.4, .36, 1); }
.levelup-img { width: 128px; height: 128px; border-radius: 16px; object-fit: cover; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18); }
.levelup-who { font-size: 13px; font-weight: 500; color: var(--ink-2); margin-top: 6px; }

/* Rail archetype avatar (replaces the emoji when levels-data.js is loaded) */
.gm-avatar { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.gm-levels-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.22);
    border-radius: 10px;
    padding: 7px 10px;
    margin: 2px 0 12px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--accent);
    cursor: pointer;
    transition: background .15s ease;
}
.gm-levels-link:hover { background: rgba(124, 58, 237, 0.15); }
.gm-head { cursor: pointer; }

/* Levels guide modal: all 10 archetypes */
.modal.levels-modal { max-width: 640px; width: 92vw; max-height: 86vh; overflow-y: auto; }
.levels-intro { font-size: 13.5px; color: var(--ink-2); margin: 4px 0 14px; }
.lv-row {
    display: flex;
    gap: 14px;
    padding: 12px;
    border-radius: 14px;
    margin-bottom: 8px;
    border: 1px solid var(--line);
}
.lv-row.current { border-color: var(--accent); background: var(--accent-soft, rgba(37, 99, 235, 0.06)); }
.lv-img { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.lv-body { flex: 1; min-width: 0; }
.lv-title { display: flex; align-items: center; gap: 8px; font-size: 14.5px; flex-wrap: wrap; }
.lv-you {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #fff;
    background: var(--accent);
    border-radius: 999px;
    padding: 2px 8px;
}
.lv-xp { margin-left: auto; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.lv-who { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.lv-pct { color: var(--ink-3); font-size: 12px; }
.lv-tip { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; margin-top: 6px; }
@media (max-width: 560px) {
    .lv-img { width: 56px; height: 56px; }
    .lv-tip { font-size: 12px; }
}
.levelup-modal h3 {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 26px;
    margin: 6px 0 4px;
}
.levelup-body { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
@keyframes gm-pop { 0% { transform: scale(.2); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }

.gm-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 4000; overflow: hidden; }
.gm-confetti i {
    position: absolute; top: -12px;
    width: 9px; height: 14px;
    border-radius: 2px;
    animation: gm-fall linear forwards;
}
@keyframes gm-fall {
    to { transform: translateY(105vh) rotate(720deg); opacity: .7; }
}

/* --- Edit-profile avatar picker --- */
.pf-avatar-row { display: flex; align-items: center; gap: 14px; }
.pf-avatar {
    background: none; border: none; padding: 0; cursor: pointer;
    border-radius: 50%; flex-shrink: 0; line-height: 0;
    position: relative;
}
.pf-avatar .avatar { pointer-events: none; }
.pf-avatar:hover { opacity: .85; }
.pf-avatar:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.pf-avatar-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.pf-photo-remove {
    background: none; border: none; padding: 0; cursor: pointer;
    font: inherit; font-size: 12.5px; color: var(--ink-3); text-decoration: underline;
}
.pf-photo-remove:hover { color: var(--danger, #d33); }
.pf-photo-hint { font-size: 12px; color: var(--ink-3); }

/* ============================================================
   Direct Messages (community: Messages panel)
   ============================================================ */
.dm-shell {
    display: grid;
    grid-template-columns: 264px 1fr;
    background: var(--bg);
    border: 1px solid var(--hairline);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    height: calc(100vh - var(--nav-h) - 150px);
    min-height: 420px;
}
.dm-list { border-right: 1px solid var(--hairline); overflow-y: auto; padding: 8px; }
.dm-list-empty { padding: 24px 14px; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.dm-thread {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    background: none;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    font: inherit;
}
.dm-thread:hover { background: var(--bg-alt); }
.dm-thread.active { background: var(--accent-soft); }
.dm-th-txt { flex: 1; min-width: 0; }
.dm-th-name { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-th-last { display: block; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.dm-thread.unread .dm-th-last { color: var(--ink); font-weight: 600; }
.dm-th-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.dm-th-time { font-size: 11px; color: var(--ink-3); }
.dm-dot {
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}
/* min-height:0 — as a grid item AND a flex column, the default min-height:auto
   floors this at content height, so a long thread grows past .dm-shell (which
   clips it) instead of letting .dm-msgs scroll. */
.dm-convo { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.dm-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--ink-3); font-size: 14px; }
.dm-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--hairline);
    flex-shrink: 0;
}
.dm-back { display: none; background: none; border: none; font-size: 18px; cursor: pointer; color: var(--ink-2); padding: 4px 8px; }
.dm-peer { display: flex; align-items: center; gap: 8px; background: none; border: none; cursor: pointer; font: inherit; font-weight: 700; font-size: 14px; color: var(--ink); }
.dm-peer:hover span { color: var(--accent); }
.dm-priv { margin-left: auto; font-size: 11.5px; color: var(--ink-3); }
.dm-msgs { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.dm-day { text-align: center; font-size: 11.5px; color: var(--ink-3); margin: 6px 0 2px; }
.dm-sayhi { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--ink-2); font-size: 14px; }
.dm-msg { max-width: 78%; align-self: flex-start; }
.dm-msg.mine { align-self: flex-end; text-align: right; }
.dm-bubble {
    display: inline-block;
    background: var(--bg-alt);
    color: var(--ink);
    padding: 8px 12px;
    border-radius: 16px;
    border-bottom-left-radius: 6px;
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
    word-break: break-word;
}
.dm-msg.mine .dm-bubble {
    background: var(--accent);
    color: #fff;
    border-radius: 16px;
    border-bottom-right-radius: 6px;
}
.dm-time { font-size: 10.5px; color: var(--ink-3); margin-top: 3px; padding: 0 4px; }
.dm-composer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--hairline);
    flex-shrink: 0;
}
.dm-composer textarea {
    flex: 1;
    resize: none;
    border: 1px solid var(--hairline);
    border-radius: 14px;
    padding: 9px 12px;
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
    max-height: 120px;
    background: var(--bg-alt);
}
.dm-composer textarea:focus { outline: none; border-color: var(--accent); background: var(--bg); }
.mm-dm { margin-left: auto; align-self: center; flex-shrink: 0; }
.cnt.dm-cnt { background: var(--accent); color: #fff; }
/* new-posts-in-space badge: filled pill, softer than the DM accent */
.cnt.unread-cnt {
    background: var(--accent-soft); color: var(--accent); font-weight: 600;
    min-width: 18px; text-align: center; padding: 1px 6px; border-radius: 9px;
}
.space-link.active .cnt.unread-cnt { display: none; }

@media (max-width: 760px) {
    .dm-shell { grid-template-columns: 1fr; height: calc(100vh - var(--nav-h) - 120px); }
    .dm-convo { display: none; }
    .dm-shell.convo-open .dm-list { display: none; }
    .dm-shell.convo-open .dm-convo { display: flex; }
    .dm-back { display: inline-block; }
}


/* ============================================================
   Daily Audio — nav mini-player pill + resource panel
   ============================================================ */

/* --- nav pill --- */
.da-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px 4px 4px;
    background: var(--accent-soft);
    border: 1px solid var(--hairline);
    border-radius: var(--r-pill);
    max-width: 260px;
    overflow: visible;
}
.da-pill-play {
    flex: none;
    width: 30px; height: 30px;
    border: none; border-radius: 50%;
    background: var(--accent); color: #fff;
    font-size: 11px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s, transform .15s;
}
.da-pill-play:hover { background: var(--accent-hover); transform: scale(1.05); }
.da-pill-play .fa-play { margin-left: 1px; }
.da-pill-mid {
    display: flex; flex-direction: column; align-items: flex-start;
    gap: 1px; min-width: 0; max-width: 168px;
    border: none; background: none; cursor: pointer; padding: 0;
    font-family: inherit; text-align: left;
}
.da-pill-eyebrow {
    font-size: 10px; font-weight: 600; letter-spacing: .02em;
    color: var(--accent); text-transform: uppercase; line-height: 1;
}
.da-pill-title {
    font-size: 13px; color: var(--ink); font-weight: 500;
    max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.da-pill-caret {
    flex: none; border: none; background: none; cursor: pointer;
    color: var(--ink-3); font-size: 11px; padding: 4px;
}
.da-pill-caret:hover { color: var(--ink); }
.da-pill-bar {
    position: absolute; left: 8px; right: 8px; bottom: 1px; height: 2px;
    background: rgba(124, 58, 237, .18); border-radius: 2px; overflow: hidden;
}
.da-pill-fill { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }

/* --- nav dropdown --- */
.da-dd {
    position: absolute; top: calc(100% + 8px); right: 0;
    width: 300px; max-width: 82vw; z-index: 1200;
    background: var(--bg); border: 1px solid var(--hairline);
    border-radius: 14px; box-shadow: var(--shadow-pop);
    padding: 6px; overflow: hidden;
}
.da-dd-row {
    display: flex; align-items: center; gap: 10px; width: 100%;
    border: none; background: none; cursor: pointer; padding: 8px;
    border-radius: 10px; text-align: left; font-family: inherit;
}
.da-dd-row:hover { background: var(--bg-alt); }
.da-dd-ic {
    flex: none; width: 26px; height: 26px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent);
    display: inline-flex; align-items: center; justify-content: center; font-size: 10px;
}
.da-dd-info { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.da-dd-title { font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.da-dd-meta { font-size: 11px; color: var(--ink-3); }
.da-dd-all {
    display: block; width: 100%; margin-top: 4px; padding: 9px;
    border: none; border-top: 1px solid var(--hairline);
    background: none; cursor: pointer; font-family: inherit;
    color: var(--accent); font-size: 13px; font-weight: 500;
}
.da-dd-all:hover { background: var(--accent-soft); }

/* --- resource panel --- */
.da-hero {
    background: var(--bg); border: 1px solid var(--hairline);
    border-radius: var(--r-card); box-shadow: var(--shadow-card);
    padding: 22px; margin-bottom: 22px;
}
.da-hero-top { display: flex; align-items: flex-start; gap: 16px; }
.da-hero-play {
    flex: none; width: 52px; height: 52px; border: none; border-radius: 50%;
    background: var(--accent); color: #fff; font-size: 18px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s, transform .15s;
}
.da-hero-play:hover { background: var(--accent-hover); transform: scale(1.05); }
.da-hero-play .fa-play { margin-left: 2px; }
.da-hero-txt { min-width: 0; }
.da-hero-eyebrow { font-size: 12px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .02em; }
.da-hero-title { font-size: 20px; line-height: 1.25; margin: 4px 0 6px; color: var(--ink); }
.da-hero-meta { font-size: 13px; color: var(--ink-3); }
.da-hero-desc { font-size: 14px; color: var(--ink-2); margin-top: 10px; }
.da-seek {
    margin: 18px 0 10px; height: 7px; border-radius: 7px;
    background: var(--hairline); cursor: pointer; overflow: hidden;
}
.da-seek-fill { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 7px; }
.da-hero-ctrls { display: flex; align-items: center; justify-content: space-between; }
.da-time { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.da-hero-actions { display: inline-flex; align-items: center; gap: 8px; }
.da-speed {
    border: 1px solid var(--hairline); background: var(--bg); cursor: pointer;
    border-radius: var(--r-pill); padding: 5px 12px; font-family: inherit;
    font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.da-speed:hover { border-color: var(--accent); color: var(--accent); }
.da-dl {
    width: 32px; height: 32px; border: 1px solid var(--hairline); border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--ink-2); font-size: 13px;
}
.da-dl:hover { border-color: var(--accent); color: var(--accent); }

.da-list { display: flex; flex-direction: column; }
.da-row {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 12px 8px; border: none; border-bottom: 1px solid var(--hairline);
    background: none; cursor: pointer; text-align: left; font-family: inherit;
    border-radius: 8px;
}
.da-row:hover { background: var(--bg-alt); }
.da-row.current { background: var(--accent-soft); }
.da-row-ic {
    flex: none; width: 34px; height: 34px; border-radius: 50%;
    background: var(--bg); border: 1px solid var(--hairline);
    color: var(--accent); font-size: 12px;
    display: inline-flex; align-items: center; justify-content: center;
}
.da-row.current .da-row-ic { background: var(--accent); color: #fff; border-color: var(--accent); }
.da-row-ic .fa-play { margin-left: 1px; }
.da-row-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.da-row-title { font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.da-row-meta { font-size: 12px; color: var(--ink-3); }

/* Center the nav pill on desktop — lift it out of the right-aligned auth
   cluster so it sits in the middle of the bar, not beside the profile icon */
@media (min-width: 700px) {
    .da-pill {
        position: absolute;
        left: 50%; top: 50%;
        transform: translate(-50%, -50%);
        margin: 0;
    }
}

@media (max-width: 640px) {
    .da-pill { max-width: none; padding: 3px; gap: 4px; }
    .da-pill-mid { display: none; }
}

/* ---------------------------------------------------------------------------
   First Win — the ten-minute onboarding for members who are new to AI.
   Deliberately roomier and warmer than the rest of the app: this is the one
   screen that has to feel like an invitation rather than a form.
   --------------------------------------------------------------------------- */

.fw-card { background: linear-gradient(160deg, #f3eefe 0%, #fff 60%); }
.fw-rail-note { font-size: 13px; color: var(--ink-2); line-height: 1.55; }

.modal.firstwin-modal { max-width: 600px; width: 92vw; max-height: 88vh; overflow-y: auto; }
.firstwin-modal .fw-head { margin-bottom: 20px; }
.firstwin-modal h3 { margin-bottom: 6px; }
.fw-kicker {
    font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--accent); margin-bottom: 8px;
}
.fw-sub { font-size: 14px; color: var(--ink-2); line-height: 1.6; }

/* Step 1 — four doors, each phrased as real life */
.fw-goals { display: grid; gap: 10px; margin-bottom: 18px; }
.fw-goal {
    display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
    border: 1px solid var(--hairline); border-radius: 16px; background: var(--bg);
    padding: 14px 16px; cursor: pointer; font-family: inherit;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.fw-goal:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.fw-goal-icon { font-size: 26px; line-height: 1; flex: 0 0 auto; }
.fw-goal-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fw-goal-text b { font-size: 15px; color: var(--ink); font-weight: 600; }
.fw-goal-text small { font-size: 12.5px; color: var(--ink-3); }

/* Step 2 — the prompt is the product; give it room to breathe */
.fw-prompt { position: relative; }
.fw-prompt textarea {
    width: 100%; border: 1px solid #d2d2d7; border-radius: 14px;
    padding: 14px 14px 52px; font-size: 14px; font-family: inherit; line-height: 1.6;
    color: var(--ink); background: var(--bg-alt); outline: none; resize: vertical;
}
.fw-prompt textarea:focus { border-color: var(--accent); background: var(--bg); }
.fw-copy { position: absolute; right: 10px; bottom: 10px; }
.fw-hint { font-size: 13px; color: var(--ink-2); line-height: 1.6; margin: 12px 0 16px; }
.fw-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.fw-tools-label { font-size: 12.5px; color: var(--ink-3); }
.fw-tool {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--hairline); border-radius: var(--r-pill);
    padding: 6px 13px; font-size: 13px; font-weight: 600;
    color: var(--ink); text-decoration: none; background: var(--bg);
}
.fw-tool:hover { border-color: var(--accent); color: var(--accent); }
.fw-tool i { font-size: 10px; opacity: 0.6; }

/* Step 3 — the gates that can stop a post, styled as help rather than a wall */
.firstwin-modal .field textarea,
.firstwin-modal .field input {
    width: 100%; border: 1px solid #d2d2d7; border-radius: 14px;
    padding: 12px 14px; font-size: 14px; font-family: inherit; line-height: 1.6;
    color: var(--ink); background: var(--bg); outline: none;
}
.firstwin-modal .field textarea:focus,
.firstwin-modal .field input:focus { border-color: var(--accent); }
.fw-gate {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    background: var(--accent-soft); border-radius: 14px; padding: 14px 16px; margin-bottom: 8px;
}
.fw-gate p { font-size: 13px; color: var(--ink); line-height: 1.55; margin: 0; flex: 1 1 220px; }
.fw-actions { justify-content: space-between; }

/* Step 4 — the celebration, and only now the profile-photo ask */
.fw-done { text-align: center; margin-bottom: 18px; }
.fw-done-icon { font-size: 46px; line-height: 1; margin-bottom: 10px; }
.fw-done h3 { margin-bottom: 6px; }
.fw-photo { margin-top: 16px; }
.fw-next {
    border-left: 3px solid var(--accent); padding: 2px 0 2px 14px; margin: 18px 0 6px;
}
.fw-next p { font-size: 13.5px; color: var(--ink-2); line-height: 1.65; margin: 0; }

@media (max-width: 640px) {
    .fw-goal { padding: 12px 13px; gap: 11px; }
    .fw-goal-icon { font-size: 22px; }
    .fw-copy { position: static; width: 100%; margin-top: 10px; }
    .fw-prompt textarea { padding-bottom: 14px; }
}

/* First Win, polish pass: mobile entry point, dismissal, retry hint */

/* The right rail is display:none below 1024px, so phones and tablets get this
   banner in the feed column instead — otherwise dismissing the flow once is
   permanent for exactly the members it was built for. */
.fw-banner {
    display: none;
    align-items: center; gap: 14px; justify-content: space-between;
    background: linear-gradient(135deg, #f3eefe 0%, #fff 70%);
    border: 1px solid var(--hairline); border-radius: var(--r-card);
    padding: 14px 16px; margin-bottom: 14px;
}
.fw-banner-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fw-banner-text b { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.fw-banner-text small { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.fw-banner .btn { flex: 0 0 auto; }
@media (max-width: 1024px) {
    .fw-banner { display: flex; }
}
@media (max-width: 480px) {
    .fw-banner { align-items: stretch; flex-direction: column; gap: 11px; }
    .fw-banner .btn { width: 100%; }
}

/* An overlay that can auto-open needs an obvious way out */
.firstwin-modal { position: relative; }
.fw-x {
    position: absolute; top: 14px; right: 14px; z-index: 2;
    width: 32px; height: 32px; border-radius: 50%;
    border: none; background: transparent; cursor: pointer;
    color: var(--ink-3); font-size: 15px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
}
.fw-x:hover { background: var(--bg-alt); color: var(--ink); }
.firstwin-modal .fw-head, .firstwin-modal .fw-done { padding-right: 34px; }

.fw-retry {
    font-size: 13px; color: var(--ink-2); line-height: 1.6;
    background: var(--bg-alt); border-radius: 12px; padding: 11px 13px; margin: -4px 0 16px;
}
.fw-banner.fw-hide { display: none !important; }
