/* ============================================================
   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;
}
.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-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);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.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; }
.reader-modal { max-width: 660px; width: 92vw; }
.reader-content { max-height: 68vh; overflow-y: auto; padding-right: 6px; }
.reader-title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 12px; }
.reader-lang { margin-bottom: 14px; }
.reader-content p { font-size: 15px; line-height: 1.7; color: var(--ink); margin-bottom: 12px; }

/* 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 */
.spaces-nav {
    position: sticky;
    top: calc(var(--nav-h) + 24px);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.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; }

/* 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; }

/* 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; }

/* 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;
}
.post-body {
    font-size: 15px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 12px;
}
.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; }
.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-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); }
.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 */
.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; }
    .app-shell {
        grid-template-columns: 1fr;
        padding: 18px 14px 90px;
        gap: 16px;
    }
    .spaces-nav {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }
    .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; }
    .auth-card { padding: 30px 22px 26px; }
}

/* ===== 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;
}

.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; }
}

.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; }
