@charset "UTF-8";
@import url("fonts.css");
@font-face {
    font-family: "Montserrat";
    src:url("montserrat.ttf") format("truetype");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary: #03304a;
    --primary-dark: #021f30;
    --primary-soft: #e4edf2;
    --secondary: #1476d4;
    --secondary-dark: #0758aa;

    --ink: #1d2226;
    --muted: #66727f;
    --muted-light: #87929d;

    --page: #f3f6f8;
    --surface: #ffffff;
    --surface-soft: #f7f9fb;
    --line: #d9e0e6;

    --danger: #b42318;
    --success: #147a45;
    --warning: #a15c00;

    --shadow:
        0 8px 25px rgba(26, 50, 75, 0.07);

    --shadow-heavy:
        0 24px 80px rgba(0, 0, 0, 0.32);

    --radius: 12px;
    --radius-sm: 8px;
    --site-width: 1460px;
}

/* =========================================================================
   Scholars Post: components
   ========================================================================= */
:root {
    --ink-soft: #3b4651;
    --focus: 0 0 0 3px rgba(234, 106, 36, .35);
    --header-h: 56px;
    --ok-soft: #e6f6ee;
    --bad-soft: #fdecea;
    color-scheme: light;
}
:root[data-theme="dark"] {
    --primary: #4a9bea; --primary-dark: #8cc2f5; --primary-soft: #16283a;
    --secondary: #5aa7ee; --secondary-dark: #8cc2f5;
    --ink: #e6ebef; --ink-soft: #c3ccd4; --muted: #9aa7b3; --muted-light: #7d8a96;
    --page: #0f1419; --surface: #182028; --surface-soft: #1e2831; --line: #2c3946;
    --danger: #f2877e; --success: #4cc38a; --warning: #e8b04a;
    --shadow: 0 8px 25px rgba(0, 0, 0, .35);
    --ok-soft: #14301f; --bad-soft: #3a1b18;
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]):not([data-theme="dark"]) {
        --primary: #4a9bea; --primary-dark: #8cc2f5; --primary-soft: #16283a;
        --secondary: #5aa7ee; --secondary-dark: #8cc2f5;
        --ink: #e6ebef; --ink-soft: #c3ccd4; --muted: #9aa7b3; --muted-light: #7d8a96;
        --page: #0f1419; --surface: #182028; --surface-soft: #1e2831; --line: #2c3946;
        --danger: #f2877e; --success: #4cc38a; --warning: #e8b04a;
        --shadow: 0 8px 25px rgba(0, 0, 0, .35);
        --ok-soft: #14301f; --bad-soft: #3a1b18;
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; background: var(--page); color: var(--ink);
    font: 400 15px/1.5 "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
img { max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.muted { color: var(--muted); }
.pad { padding: 14px 16px; }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 999; }
.skip-link:focus { left: 8px; }
.link { color: var(--primary); font-weight: 600; }
.link-btn { background: none; border: 0; color: var(--primary); font-weight: 600; padding: 0; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 38px; padding: 8px 18px; border-radius: 999px; border: 1.5px solid transparent;
    font-weight: 600; font-size: 14px; line-height: 1.2; text-decoration: none !important; transition: background .15s, border-color .15s, opacity .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #0b1620; }
:root[data-theme="dark"] .btn-primary:hover { color: #0b1620; background: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-sm { min-height: 30px; padding: 4px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn.is-loading .btn-label::after { content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 8px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -2px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { max-width: var(--site-width); margin: 0 auto; height: var(--header-h); padding: 0 20px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; flex: none; }
.brand-full { height: 34px; width: auto; }
.brand-icon { display: none; }
.header-search { position: relative; flex: 0 1 320px; }
.header-search .fa-solid { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }
.header-search input { width: 100%; height: 38px; border: 1px solid transparent; background: var(--page); border-radius: 8px; padding: 0 12px 0 36px; }
.header-search input:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: var(--focus); }
.header-nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 62px; padding: 6px 10px; background: none; border: 0; color: var(--muted); font-size: 11.5px; font-weight: 500; border-radius: 8px; text-decoration: none !important; }
.nav-item .fa-solid { font-size: 18px; }
.nav-item:hover, .nav-item.is-active { color: var(--ink); }
.nav-item.is-active { box-shadow: inset 0 -2px 0 var(--ink); border-radius: 0; }
.nav-item.is-soon { opacity: .75; }
.nav-icon-wrap { position: relative; display: inline-flex; }
.count-badge { position: absolute; top: -6px; right: -9px; min-width: 17px; height: 17px; padding: 0 4px; background: #cc1016; color: #fff; border-radius: 9px; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.header-nav > .btn { margin-left: 8px; }
.theme-icon-light { display: none; }
:root[data-theme="dark"] .theme-icon-light { display: inline-block; }
:root[data-theme="dark"] .theme-icon-dark { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]):not([data-theme="dark"]) .theme-icon-light { display: inline-block; }
    :root:not([data-theme="light"]):not([data-theme="dark"]) .theme-icon-dark { display: none; }
}
.nav-profile .avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.nav-profile span:last-child { font-size: 11.5px; }

.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-heavy); padding: 6px; display: none; z-index: 120; }
.dropdown.open > .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 8px; color: var(--ink); background: none; border: 0; text-align: left; font-size: 14px; text-decoration: none !important; }
.dropdown-menu a:hover, .dropdown-menu button.menu-item:hover { background: var(--surface-soft); }
.dropdown-menu .fa-solid { width: 18px; color: var(--muted); }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.dropdown-menu .danger, .dropdown-menu .danger .fa-solid { color: var(--danger); }
.profile-menu { width: 280px; }
.profile-menu-head { align-items: flex-start !important; gap: 12px !important; padding: 12px !important; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0 !important; margin-bottom: 6px; }
.profile-menu-head span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.profile-menu-head small { color: var(--muted); font-size: 12px; }
.sid-chip { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--primary); background: var(--primary-soft); padding: 2px 8px; border-radius: 999px; align-self: flex-start; letter-spacing: .02em; }
.soon-tag { font-style: normal; font-size: 10px; font-weight: 700; background: var(--primary-soft); color: var(--primary); padding: 1px 7px; border-radius: 999px; margin-left: auto; }
.dropdown-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.notif-menu { width: 360px; max-width: calc(100vw - 24px); padding: 0; }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif-item { display: flex !important; gap: 10px; align-items: flex-start; border-radius: 0 !important; padding: 11px 14px !important; border-bottom: 1px solid var(--line); }
.notif-item:last-child { border-bottom: 0; }
.notif-item.unread { background: var(--primary-soft); }
.notif-item div { min-width: 0; font-size: 13.5px; }
.notif-item small { display: block; color: var(--muted); font-size: 12px; }
.notif-item p { margin: 2px 0 0; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.verify-banner { background: #fff4d6; color: #5c4200; border-bottom: 1px solid #f0d58a; padding: 8px 20px; display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.verify-banner .link-btn { color: #7a4f00; text-decoration: underline; }
:root[data-theme="dark"] .verify-banner { background: #3a2f12; color: #f3dc9b; border-color: #5b4a1c; }
:root[data-theme="dark"] .verify-banner .link-btn { color: #f3dc9b; }

/* ---------- Avatars ---------- */
.avatar { position: relative; display: inline-grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 16px; overflow: hidden; line-height: 1; user-select: none; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 52px; height: 52px; }
.avatar-xl { width: 72px; height: 72px; font-size: 24px; border: 3px solid var(--surface); }
.avatar-2xl { width: 112px; height: 112px; font-size: 38px; border: 4px solid var(--surface); }

/* ---------- Layout ---------- */
.layout { max-width: var(--site-width); margin: 0 auto; padding: 20px; display: grid; gap: 20px; align-items: start; }
.layout-feed { grid-template-columns: 240px minmax(0, 1fr) 300px; max-width: 1100px; }
.layout-profile { grid-template-columns: minmax(0, 820px); justify-content: center; }
.col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.col-left, .col-right { position: sticky; top: calc(var(--header-h) + 20px); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.page-narrow { max-width: 480px; margin: 36px auto; padding: 0 16px; }
.page-narrow.wide { max-width: 780px; }
.auth-card { padding: 28px; }
.auth-card h1 { margin: 0 0 6px; font-size: 24px; }
.auth-alt { text-align: center; margin: 18px 0 0; color: var(--muted); font-size: 14px; }
.status-icon { font-size: 44px; margin-bottom: 8px; }
.status-icon.ok { color: var(--success); } .status-icon.bad { color: var(--danger); }

.profile-card { overflow: hidden; text-align: center; }
.profile-card-cover { height: 58px; background: linear-gradient(120deg, var(--primary), var(--secondary-dark)); }
.profile-card-cover.tall { height: 130px; }
.profile-card-body { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 0 14px 12px; margin-top: -36px; color: var(--ink); text-decoration: none !important; }
.profile-card-body small { color: var(--muted); font-size: 12.5px; }
.profile-card-body .sid-chip { align-self: center; margin-top: 4px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-top: 1px solid var(--line); }
.stat-row div { padding: 10px 4px; text-align: center; }
.stat-row dt { font-size: 11px; color: var(--muted); }
.stat-row dd { margin: 0; font-weight: 700; font-size: 15px; }
.stat-row-lg dd { font-size: 20px; }
.quick-links { padding: 6px; }
.quick-links a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; color: var(--ink); font-size: 14px; text-decoration: none !important; }
.quick-links a:hover { background: var(--surface-soft); }
.quick-links .fa-solid { color: var(--muted); width: 18px; }
.join-card { padding: 20px 18px; display: flex; flex-direction: column; gap: 10px; text-align: center; align-items: center; }
.join-card h2 { margin: 0; font-size: 17px; } .join-card p { margin: 0; color: var(--muted); font-size: 13.5px; }

.side-card { padding: 14px 16px; }
.side-card h3 { margin: 0 0 10px; font-size: 14px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.suggest-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.suggest { display: flex; gap: 10px; align-items: center; }
.suggest-info { min-width: 0; flex: 1; }
.suggest-info a { display: block; font-weight: 600; font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-info small { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.side-foot { font-size: 12px; color: var(--muted); text-align: center; margin: 0; }

/* ---------- Composer trigger / tabs ---------- */
.composer-trigger { display: flex; gap: 12px; padding: 14px 16px; align-items: center; }
.composer-fake { flex: 1; text-align: left; height: 46px; padding: 0 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-weight: 500; }
.composer-fake:hover { background: var(--surface-soft); }
.feed-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.feed-tab { padding: 10px 16px; font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; text-decoration: none !important; }
.feed-tab:hover { color: var(--ink); }
.feed-tab.is-active { color: var(--primary); border-color: var(--primary); }
.filter-note { padding: 10px 14px; background: var(--primary-soft); border-radius: var(--radius-sm); display: flex; gap: 12px; justify-content: space-between; font-size: 14px; }
.section-title { margin: 6px 4px 0; font-size: 17px; }

/* ---------- Feed / posts ---------- */
.feed { display: flex; flex-direction: column; gap: 14px; }
.feed-status { text-align: center; padding: 18px; color: var(--muted); font-size: 14px; }
.feed-empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.feed-empty .fa-solid { font-size: 34px; margin-bottom: 10px; display: block; width: auto; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
.post { padding: 16px 16px 6px; }
.post-head { display: flex; gap: 12px; align-items: flex-start; }
.post-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.post-author { font-weight: 700; color: var(--ink); font-size: 15px; }
.post-meta small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-meta .sub { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.badge { font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); text-transform: capitalize; }
.badge.question { background: #fff0d9; color: #965a00; } .badge.paper, .badge.preprint { background: #e7f6ee; color: #12683d; } .badge.announcement { background: #fdeaf1; color: #a1285a; } .badge.resource { background: #ece8fb; color: #4d3ba8; }
:root[data-theme="dark"] .badge.question { background: #3a2c12; color: #f0c06a; } :root[data-theme="dark"] .badge.paper, :root[data-theme="dark"] .badge.preprint { background: #14301f; color: #6fd7a0; } :root[data-theme="dark"] .badge.announcement { background: #3a1a29; color: #f09bbd; } :root[data-theme="dark"] .badge.resource { background: #261f45; color: #b6a8f2; }
.post-title { margin: 12px 0 4px; font-size: 18px; line-height: 1.35; }
.post-title a { color: var(--ink); }
.post-body { word-wrap: break-word; overflow-wrap: anywhere; color: var(--ink-soft); }
.post-body p { margin: 0 0 8px; }
.post-body.clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.post-body a { text-decoration: underline; }
.mention { color: var(--primary); font-weight: 600; }
.read-more { background: none; border: 0; color: var(--muted); font-weight: 600; padding: 2px 0; }
.read-more:hover { color: var(--primary); }
.link-card { display: flex; gap: 10px; align-items: center; margin-top: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); color: var(--ink); text-decoration: none !important; }
.link-card:hover { border-color: var(--primary); }
.link-card strong { font-size: 13.5px; display: block; } .link-card small { color: var(--muted); }
.post-images { display: grid; gap: 3px; margin: 12px -16px 0; background: var(--line); }
.post-images.n1 { grid-template-columns: 1fr; }
.post-images.n2 { grid-template-columns: 1fr 1fr; }
.post-images.n3 { grid-template-columns: 1fr 1fr; } .post-images.n3 .post-img:first-child { grid-column: 1 / -1; }
.post-images.n4 { grid-template-columns: 1fr 1fr; }
.post-img { position: relative; padding: 0; border: 0; background: var(--surface-soft); aspect-ratio: 4 / 3; overflow: hidden; display: block; }
.post-images.n1 .post-img { aspect-ratio: auto; max-height: 560px; }
.post-images.n3 .post-img:first-child { aspect-ratio: 16 / 9; }
.post-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.post-images.n1 .post-img img { height: auto; max-height: 560px; object-fit: contain; background: var(--surface-soft); }
.post-img:hover img { transform: scale(1.02); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { display: inline-flex; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); text-decoration: none !important; }
.tag:hover { background: var(--primary); color: #fff; }
.post-stats { display: flex; gap: 14px; margin-top: 12px; padding-bottom: 8px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); }
.post-actions { display: flex; gap: 2px; padding: 4px 0; }
.act { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 6px; background: none; border: 0; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 11px; }
.act:hover { background: var(--surface-soft); color: var(--ink); }
.act.on { color: var(--primary); }
.act .fa-solid { font-size: 16px; }
.post-more { margin-left: 4px; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 50%; border: 0; background: none; color: var(--muted); }
.icon-btn:hover { background: var(--surface-soft); color: var(--ink); }
.ad-card { padding: 16px; border: 1px solid var(--line); border-left: 4px solid var(--primary); }
.ad-top { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.ad-card img.ad-img { width: 100%; max-height: 220px; object-fit: cover; border-radius: var(--radius-sm); margin-top: 10px; }
.ad-card h3 { margin: 8px 0 4px; font-size: 17px; } .ad-card p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }

/* ---------- Forms ---------- */
.auth-form, .modal-body { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; }
.field > span { font-weight: 600; }
.field em { font-weight: 400; color: var(--muted); font-style: normal; }
.field input, .field select, .field textarea, .tag-input { width: 100%; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus, .tag-input:focus-within { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
.field.has-error input, .field.has-error textarea, .field.has-error select, .field.has-error .tag-input { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 12.5px; min-height: 0; }
.field-error:empty { display: none; }
.field-hint { color: var(--muted); font-size: 12px; text-align: right; }
.field-grid { display: grid; grid-template-columns: 90px 1fr 1fr; gap: 10px; }
.field-grid-2 { grid-template-columns: 1fr 1fr; }
.form-row { display: flex; justify-content: flex-end; font-size: 13px; margin-top: -6px; }
.form-alert { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--bad-soft); color: var(--danger); font-size: 13.5px; }
.form-alert.ok { background: var(--ok-soft); color: var(--success); }
.input-wrap { position: relative; display: block; }
.input-wrap input { padding-right: 42px; }
.input-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: none; color: var(--muted); border-radius: 6px; }
.check { display: flex; gap: 10px; font-size: 13px; color: var(--muted); align-items: flex-start; }
.check input { margin-top: 3px; accent-color: var(--primary); }
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 8px; }
.tag-input input { flex: 1; min-width: 140px; border: 0 !important; box-shadow: none !important; padding: 4px; background: transparent; outline: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 10px; background: var(--primary-soft); color: var(--primary); border-radius: 999px; font-size: 13px; font-weight: 600; }
.chip button { border: 0; background: none; color: inherit; padding: 0 2px; font-size: 15px; line-height: 1; }
.image-picker { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.image-previews { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.image-previews:empty { display: none; }
.thumb { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-soft); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; }
.more-options summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--primary); margin-bottom: 10px; }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 14, 20, .62); }
.modal-dialog { position: relative; width: 100%; max-width: 640px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-heavy); animation: pop .18s ease-out; }
.modal-auth { max-width: 600px; padding: 0 0 24px; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--surface-soft); color: var(--ink); z-index: 5; }
.modal-close:hover { background: var(--line); }
.modal-close.static { position: static; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.compose-who { display: flex; gap: 12px; align-items: center; } .compose-who small { display: block; color: var(--muted); }
.modal-body { padding: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); }
.auth-hero { text-align: center; padding: 28px 28px 8px; }
.auth-hero h2 { margin: 12px 0 4px; font-size: 21px; } .auth-hero p { margin: 0; color: var(--muted); font-size: 14px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 16px 28px 0; border-bottom: 1px solid var(--line); }
.auth-tabs button { background: none; border: 0; padding: 10px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.auth-tabs button[aria-selected="true"] { color: var(--primary); border-color: var(--primary); }
.auth-panel { padding: 18px 28px 0; }

/* Post detail modal: 80% post / 20% comments */
.modal-post { padding: 0; }
.post-dialog { position: relative; display: grid; grid-template-columns: 80fr 20fr; width: 100%; height: 100%; max-width: 1760px; background: var(--surface); overflow: hidden; animation: pop .18s ease-out; }
@media (min-width: 1100px) { .modal-post { padding: 20px; } .post-dialog { border-radius: 16px; box-shadow: var(--shadow-heavy); } }
.pm-main { overflow-y: auto; min-width: 0; display: flex; flex-direction: column; background: var(--page); }
.pm-side { display: flex; flex-direction: column; min-width: 0; border-left: 1px solid var(--line); background: var(--surface); }
.pm-side-head { padding: 16px 14px 12px; border-bottom: 1px solid var(--line); padding-right: 54px; }
.pm-comments { flex: 1; overflow-y: auto; padding: 12px 12px; }
.pm-composer { position: relative; border-top: 1px solid var(--line); padding: 10px 12px; background: var(--surface); }
.pm-composer-row { display: flex; gap: 8px; align-items: flex-end; }
.pm-composer textarea { flex: 1; resize: none; max-height: 140px; padding: 9px 12px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 18px; line-height: 1.4; }
.pm-composer textarea:focus { outline: none; border-color: var(--primary); }
.reply-bar { display: flex; justify-content: space-between; align-items: center; background: var(--primary-soft); color: var(--primary); padding: 5px 10px; border-radius: 8px; font-size: 12.5px; margin-bottom: 8px; }
.reply-bar button { background: none; border: 0; color: inherit; }
.mention-menu { position: absolute; left: 12px; right: 12px; bottom: calc(100% - 4px); max-height: 220px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-heavy); padding: 4px; z-index: 10; }
.mention-opt { display: flex; gap: 10px; align-items: center; width: 100%; padding: 7px 8px; background: none; border: 0; border-radius: 8px; text-align: left; }
.mention-opt:hover, .mention-opt.active { background: var(--primary-soft); }
.mention-opt small { display: block; color: var(--muted); font-size: 11.5px; }
.carousel { position: relative; background: #0b0f13; flex: none; }
.carousel-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; height: min(66vh, 720px); }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-slide { flex: 0 0 100%; scroll-snap-align: center; display: grid; place-items: center; }
.carousel-slide img { max-width: 100%; max-height: 100%; object-fit: contain; }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.88); color: #111; box-shadow: 0 2px 10px rgba(0,0,0,.35); z-index: 2; }
.carousel-btn.prev { left: 12px; } .carousel-btn.next { right: 12px; }
.carousel-btn[disabled] { opacity: 0; pointer-events: none; }
.carousel-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.carousel-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.45); }
.carousel-dots i.on { background: #fff; }
.carousel-count { position: absolute; top: 12px; left: 12px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.pm-detail { padding: 22px 28px 40px; background: var(--surface); flex: 1; }
.pm-detail .post-title { font-size: 24px; margin-top: 14px; }
.pm-detail .post-body { font-size: 16px; line-height: 1.65; color: var(--ink); }
.pm-detail .post-actions { margin-top: 6px; }
.comment { display: flex; gap: 8px; margin-bottom: 12px; }
.comment .avatar { width: 30px; height: 30px; font-size: 11px; }
.comment-main { min-width: 0; flex: 1; }
.comment-bubble { background: var(--surface-soft); border-radius: 4px 14px 14px 14px; padding: 8px 12px; }
.comment-bubble header { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.comment-bubble header a { font-weight: 700; color: var(--ink); font-size: 13px; }
.comment-bubble time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.comment-body { font-size: 13.5px; overflow-wrap: anywhere; margin-top: 2px; }
.comment-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 3px 4px 0; font-size: 12px; }
.comment-actions button { background: none; border: 0; padding: 0; color: var(--muted); font-weight: 600; }
.comment-actions button:hover, .comment-actions button.on { color: var(--primary); }
.replies { margin-top: 8px; padding-left: 4px; border-left: 2px solid var(--line); }
.replies .comment { margin: 8px 0 0 8px; }
.empty-comments { text-align: center; color: var(--muted); padding: 28px 8px; font-size: 13.5px; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 400; background: #1d2226; color: #fff; padding: 11px 20px; border-radius: 999px; box-shadow: var(--shadow-heavy); font-size: 14px; max-width: calc(100vw - 32px); animation: pop .18s; }
.toast.error { background: #b42318; } .toast.ok { background: #147a45; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 40px; }
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 28px 20px; display: grid; grid-template-columns: 1fr auto; gap: 14px 40px; }
.footer-brand p { color: var(--muted); font-size: 13.5px; max-width: 520px; margin: 8px 0 0; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; font-size: 14px; }
.footer-links a { color: var(--ink-soft); font-weight: 500; }
.footer-copy { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12.5px; }

/* ---------- Profile ---------- */
.profile-hero { overflow: hidden; }
.profile-hero-body { display: flex; gap: 18px; padding: 0 24px 16px; margin-top: -56px; align-items: flex-end; flex-wrap: wrap; }
.profile-hero-main { flex: 1; min-width: 220px; padding-top: 60px; }
.profile-hero-main h1 { margin: 0; font-size: 24px; } .profile-hero-main p { margin: 3px 0; }
.headline { font-weight: 500; }
.profile-hero-actions { padding-bottom: 8px; }
.profile-bio { padding: 16px 24px 22px; border-top: 1px solid var(--line); } .profile-bio h2 { font-size: 16px; margin: 0 0 6px; }
.post-static { padding: 24px; } .post-static h1 { font-size: 26px; } .post-static-head { display: flex; gap: 12px; align-items: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
    .layout-feed { grid-template-columns: 220px minmax(0, 1fr); }
    .col-right { display: none; }
}
@media (max-width: 760px) {
    .header-inner { padding: 0 10px; gap: 8px; }
    .brand-text { display: none; }
    .header-search { flex: 1; }
    .nav-item { min-width: 40px; padding: 6px; } .nav-item span:not(.nav-icon-wrap):not(.count-badge) { display: none; }
    .nav-item.is-soon { display: none; }
    .header-nav > .btn { padding: 6px 12px; font-size: 13px; margin-left: 2px; } .header-nav > .btn-ghost { display: none; }
    .layout-feed { grid-template-columns: minmax(0, 1fr); padding: 12px; }
    .col-left { display: none; }
    .post { padding: 14px 14px 4px; } .post-images { margin: 12px -14px 0; }
    .act span { display: none; }
    .footer-inner { grid-template-columns: 1fr; }
    .field-grid { grid-template-columns: 1fr 1fr; } .field-grid .field-sm { grid-column: 1 / -1; }
    .auth-hero, .auth-panel { padding-left: 18px; padding-right: 18px; } .auth-tabs { margin: 16px 18px 0; }
    .modal { padding: 0; align-items: flex-end; } .modal-dialog { max-height: 94vh; border-radius: 16px 16px 0 0; }
    .post-dialog { grid-template-columns: 1fr; grid-template-rows: minmax(0, 58fr) minmax(0, 42fr); }
    .pm-side { border-left: 0; border-top: 1px solid var(--line); }
    .carousel-track { height: 42vh; }
    .pm-detail { padding: 16px; }
    .auth-card { padding: 20px; }
}
@media (max-width: 1100px) and (min-width: 761px) {
    .post-dialog { grid-template-columns: 65fr 35fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }


/* =========================================================================
   Scholars Post: "scholar" look (warm paper background, indigo accent, serif headings)
   Placed last so it overrides the base tokens above.
   ========================================================================= */
:root {
    /* Brand palette from the logo: navy #03304a (primary) and orange #ea6a24 (accent) */
    --primary: #03304a; --primary-dark: #021f30; --primary-soft: #e4edf2;
    --secondary: #0b4a6e; --secondary-dark: #021f30;
    --accent: #ea6a24; --accent-dark: #c4540f; --accent-soft: #fdeee4;
    --ink: #11222e; --ink-soft: #3d4f5c; --muted: #6a7b88; --muted-light: #94a2ad;
    --page: #f3f6f8; --surface: #ffffff; --surface-soft: #f8fafb; --line: #dde5ea;
    --shadow: 0 1px 2px rgba(3, 48, 74, .06), 0 4px 14px rgba(3, 48, 74, .05);
    --radius: 14px;
    --serif: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --focus: 0 0 0 3px rgba(234, 106, 36, .35);
}
:root[data-theme="dark"] {
    --primary: #6cb6dc; --primary-dark: #a6d4ec; --primary-soft: #0f3550;
    --secondary: #6cb6dc; --secondary-dark: #a6d4ec;
    --accent: #f48b50; --accent-dark: #f7aa7e; --accent-soft: #3a2316;
    --ink: #e8eff3; --ink-soft: #bccad3; --muted: #8fa2af; --muted-light: #70838f;
    --page: #08171f; --surface: #0f2330; --surface-soft: #142d3d; --line: #223f52;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 4px 14px rgba(0,0,0,.28);
    --focus: 0 0 0 3px rgba(244, 139, 80, .4);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]):not([data-theme="dark"]) {
        --primary: #6cb6dc; --primary-dark: #a6d4ec; --primary-soft: #0f3550;
        --secondary: #6cb6dc; --secondary-dark: #a6d4ec;
        --accent: #f48b50; --accent-dark: #f7aa7e; --accent-soft: #3a2316;
        --ink: #e8eff3; --ink-soft: #bccad3; --muted: #8fa2af; --muted-light: #70838f;
        --page: #08171f; --surface: #0f2330; --surface-soft: #142d3d; --line: #223f52;
        --shadow: 0 1px 2px rgba(0,0,0,.35), 0 4px 14px rgba(0,0,0,.28);
    }
}
:root[data-theme="dark"] .btn-primary, :root[data-theme="dark"] .btn-primary:hover { color: #03202f; }
.post-title, .post-title a, .pm-detail .post-title, .post-static h1, .profile-hero-main h1, .auth-card h1, .auth-hero h2, .join-card h2, .gate-card h3 {
    font-family: var(--serif); font-weight: 700; letter-spacing: -.005em;
}
.site-header { background: var(--surface); }
.header-search input { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 999px; padding-left: 38px; }
.header-search input:focus { background: var(--surface); }
.nav-item.is-active { box-shadow: inset 0 -2px 0 var(--primary); color: var(--primary); }

/* left column */
.profile-card { text-align: center; }
.profile-card-cover { display: none; }
.profile-card-body { margin-top: 0; padding: 20px 16px 14px; }
.profile-card-body .avatar-xl { width: 64px; height: 64px; border: 0; }
.profile-card-body strong { font-family: var(--serif); font-size: 16px; margin-top: 8px; }
.stat-row { border-top: 1px solid var(--line); }
.stat-row dt { order: 2; margin-top: 2px; font-size: 11.5px; } .stat-row div { display: flex; flex-direction: column; }
.stat-row dd { order: 1; }
.quick-links { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.quick-links a { padding: 9px 12px; border-radius: 10px; color: var(--ink-soft); font-weight: 500; }
.quick-links a.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.quick-links a.is-soon { color: var(--muted); }
.quick-links .soon-tag { margin-left: 8px; background: var(--surface-soft); color: var(--muted); border: 1px solid var(--line); font-weight: 500; }

/* composer */
.composer-trigger { padding: 14px; align-items: flex-start; }
.composer-fake { height: auto; min-height: 66px; padding: 12px 16px; border-radius: 12px; background: var(--surface-soft); border: 1px solid var(--line); color: var(--muted); font-weight: 400; line-height: 1.45; }
.composer-fake:hover { border-color: var(--primary); background: var(--surface-soft); }

/* pill tabs + type chips */
.feed-tabs { gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); justify-content: space-between; }
.feed-tab { flex: 1; text-align: center; padding: 8px 8px; font-size: 13.5px; white-space: nowrap; border: 0; border-radius: 999px; color: var(--ink-soft); font-weight: 500; }
.feed-tab:hover { background: var(--surface-soft); color: var(--ink); }
.feed-tab.is-active { background: var(--primary); color: #fff; font-weight: 600; }
:root[data-theme="dark"] .feed-tab.is-active { color: #03202f; }
.type-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.type-chip { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-soft); font-size: 13.5px; font-weight: 500; text-decoration: none !important; }
.type-chip:hover { border-color: var(--primary); }
.type-chip.is-active { background: var(--primary-soft); border-color: transparent; color: var(--primary); font-weight: 600; }

/* post card */
.post { padding: 18px 20px 6px; }
.post-images { margin: 12px -20px 0; }
.badge { order: -1; text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; padding: 3px 10px; }
.post-meta .sub { margin-top: 1px; }
.tag, .chip { background: var(--surface-soft); color: var(--ink-soft); border: 1px solid var(--line); font-weight: 500; }
.tag:hover { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.chip { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.link-card { background: var(--surface-soft); border-radius: 12px; }
.btn-primary { background: var(--primary); }
.post-stats { border-bottom-color: var(--line); }

/* right column */
.side-card h3 { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.suggest-list { gap: 0; } .suggest { padding: 10px 0; border-bottom: 1px solid var(--line); } .suggest:last-child { border-bottom: 0; padding-bottom: 0; }
.feed-error { color: var(--danger); }
.pm-main { background: var(--page); }

@media (max-width: 760px) { .feed-tabs { overflow-x: auto; justify-content: flex-start; } .feed-tab { flex: none; } }


/* ---- Wider feed + 1rem (12px) base text ---- */
html { font-size: 12px; }                 /* 1rem = 12px; change this one value to scale text everywhere rem is used */
body { font-size: 1rem; line-height: 1.55; }
.layout-feed { max-width: 1400px; grid-template-columns: 250px minmax(0, 1fr) 310px; }
.post-body, .post-meta small, .comment-body, .field, .quick-links a { font-size: 1rem; }
.pm-detail .post-body { font-size: 1.15rem; }
@media (max-width: 1020px) { .layout-feed { grid-template-columns: 220px minmax(0, 1fr); } }
@media (max-width: 760px) { .layout-feed { grid-template-columns: minmax(0, 1fr); } }

/* ---- Actions on the left, counters on the right ---- */
.post-actions { align-items: center; border-top: 1px solid var(--line); margin-top: 12px; padding: 4px 0; }
.post-actions .act { flex: 0 0 auto; padding: 9px 14px; }
.post-counters { margin-left: auto; display: flex; gap: 14px; align-items: center; color: var(--muted); font-size: 12.5px; padding-left: 10px; white-space: nowrap; }
.counter { display: inline-flex; align-items: center; gap: 5px; }
.counter .fa-solid { font-size: 12px; width: auto; }
.counter b { color: var(--ink-soft); font-weight: 600; }
@media (max-width: 900px) { .counter-label { display: none; } }
@media (max-width: 760px) { .post-actions .act { padding: 9px 10px; } .post-counters { gap: 10px; } }

/* ---- Left column: smaller icons and text ---- */
.col-left .profile-card-body { padding: 16px 12px 10px; }
.col-left .profile-card-body .avatar-xl { width: 52px; height: 52px; font-size: 18px; }
.col-left .profile-card-body strong { font-size: 14px; margin-top: 6px; }
.col-left .profile-card-body small { font-size: 11.5px; }
.col-left .sid-chip { font-size: 10.5px; padding: 1px 7px; }
.col-left .stat-row div { padding: 8px 2px; }
.col-left .stat-row dd { font-size: 13px; }
.col-left .stat-row dt { font-size: 10.5px; }
.col-left .quick-links { padding: 6px; }
.col-left .quick-links a { padding: 7px 10px; font-size: 12.5px; gap: 8px; }
.col-left .quick-links .fa-solid { font-size: 12px; }
.col-left .quick-links .soon-tag { font-size: 9px; padding: 0 6px; }
.col-left .join-card h2 { font-size: 15px; } .col-left .join-card p { font-size: 12px; }
.col-left .join-card .btn { min-height: 32px; font-size: 13px; }

/* ---- Smaller Upvote / Comment / Save / Share buttons ---- */
.post-actions .act { padding: 6px 10px; gap: 6px; font-size: 11px; }
.post-actions .act .fa-solid { font-size: 12px; width: auto; }
.post-counters { font-size: 11.5px; gap: 12px; }
.counter .fa-solid { font-size: 11px; }

/* ---- Counters: icon + number only ---- */
.counter-label { display: none !important; }
.post-counters { gap: 10px; }

/* ---- Post modal: image fills the available height, so the left panel does not scroll twice ---- */
.pm-main { overflow: hidden; }
.carousel { flex: 1 1 auto; min-height: 220px; height: auto; display: flex; }
.carousel-track { flex: 1; height: auto; min-height: 0; }
.carousel-slide { height: 100%; }
.carousel-slide img { width: 100%; height: 100%; object-fit: contain; }
.pm-detail { flex: 0 1 auto; max-height: 42%; overflow-y: auto; padding: 14px 24px 16px; }
.pm-main:not(:has(.carousel)) .pm-detail { flex: 1; max-height: none; }
.pm-detail .post-title { margin-top: 10px; font-size: 20px; }
.pm-detail .tag-row { margin-top: 8px; }
@media (max-width: 760px) { .pm-detail { max-height: 50%; padding: 12px 14px; } }

/* ---- Rich text editor (compose modal) ---- */
.rte { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.rte:focus-within { border-color: var(--primary); box-shadow: var(--focus); }
.field.has-error .rte { border-color: var(--danger); }
.rte-toolbar { display: flex; align-items: center; gap: 2px; padding: 4px 6px; background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.rte-btn { width: 30px; height: 30px; display: inline-grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--ink-soft); font-size: 13px; }
.rte-btn .fa-solid { width: auto; }
.rte-btn:hover { background: var(--line); color: var(--ink); }
.rte-btn.on { background: var(--primary-soft); color: var(--primary); }
.rte-sep { width: 1px; height: 18px; background: var(--line); margin: 0 6px; }
.rte-editor { min-height: 150px; max-height: 38vh; overflow-y: auto; padding: 10px 12px; outline: none; line-height: 1.55; overflow-wrap: anywhere; font-weight: 400; }
.rte-editor:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.rte-editor p { margin: 0 0 8px; }
.rte-editor ul, .rte-editor ol, .post-body ul, .post-body ol { margin: 4px 0 8px; padding-left: 22px; }
.rte-editor li, .post-body li { margin: 2px 0; }
.post-body u, .rte-editor u { text-decoration: underline; }

/* ---- Full post page (/posts/<slug>) ---- */
.layout-post { max-width: 1400px; grid-template-columns: 250px minmax(0, 1fr) 310px; }
.post-page { gap: 14px; }
.post-page .carousel { border-radius: var(--radius); overflow: hidden; height: min(62vh, 640px); flex: none; box-shadow: var(--shadow); }
.post-page .carousel-track { height: 100%; }
.post-article { padding: 20px 24px 8px; }
.post-article .post-title { font-size: 26px; margin: 14px 0 8px; line-height: 1.3; }
.post-article .post-body { font-size: 1.15rem; line-height: 1.7; color: var(--ink); }
.post-article .post-actions { margin-top: 16px; }
.comments-card { padding: 0; overflow: hidden; }
.comments-card .pm-side { border: 0; background: transparent; }
.comments-card .pm-side-head { padding: 14px 18px; }
.comments-card .pm-comments { overflow: visible; padding: 14px 18px; }
.comments-card .pm-composer { position: static; padding: 12px 18px 16px; }
.comments-card .mention-menu { bottom: calc(100% - 8px); }
.mini-stats { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-stats div { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.mini-stats dt { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.mini-stats dd { margin: 2px 0 0; font-weight: 700; font-size: 16px; }
.top-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; counter-reset: top; }
.top-list li { counter-increment: top; position: relative; padding-left: 26px; }
.top-list li::before { content: counter(top); position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.top-list a { display: block; color: var(--ink); font-weight: 600; font-size: 13px; line-height: 1.35; }
.top-list small { color: var(--muted); font-size: 11.5px; }
.cat-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.cat-list a { display: flex; justify-content: space-between; align-items: center; padding: 7px 4px; color: var(--ink-soft); font-size: 13px; border-bottom: 1px solid var(--line); text-decoration: none !important; }
.cat-list li:last-child a { border-bottom: 0; }
.cat-list a:hover { color: var(--primary); }
.cat-list b { font-size: 11.5px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; color: var(--muted); }
@media (max-width: 1020px) { .layout-post { grid-template-columns: minmax(0, 1fr); } .layout-post .col-left, .layout-post .col-right { display: flex; position: static; order: 2; } .layout-post .col-center { order: 1; } }
@media (max-width: 760px) { .post-page .carousel { height: 42vh; } .post-article { padding: 16px 16px 6px; } .post-article .post-title { font-size: 21px; } }
.ad-top { gap: 8px; flex-wrap: wrap; }

/* ---- Montserrat everywhere (icons keep Font Awesome) ---- */
html, body, button, input, select, textarea, optgroup, option, .post-title, .post-title a, .profile-card-body strong, .mono, code, pre {
    font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.post-title, .pm-detail .post-title, .post-static h1, .profile-hero-main h1, .auth-card h1, .auth-hero h2, .join-card h2, .gate-card h3 { font-weight: 700; }

/* ---- Feed card images: up to four small thumbnails in one row ---- */
.post-images { display: flex; flex-wrap: nowrap; gap: 8px; margin: 12px 0 0; background: none; }
.post-images.n1, .post-images.n2, .post-images.n3, .post-images.n4 { display: flex; grid-template-columns: none; }
.post-images.n3 .post-img:first-child { grid-column: auto; aspect-ratio: 4 / 3; }
.post-img, .post-images.n1 .post-img, .post-images.n3 .post-img:first-child { flex: 0 0 calc((100% - 24px) / 4); max-width: 150px; aspect-ratio: 4 / 3; max-height: none; border-radius: 8px; border: 1px solid var(--line); }
.post-img img, .post-images.n1 .post-img img { width: 100%; height: 100%; max-height: none; object-fit: cover; background: var(--surface-soft); }

/* ======================================================================
   Profile (3 columns) + Projects workspace
   ====================================================================== */
.layout-profile { max-width: 1400px; grid-template-columns: 260px minmax(0, 1fr) 310px; justify-content: stretch; }
.side-card { padding: 14px 16px; }
.side-title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 14px; font-weight: 700; }
.side-title .fa-solid { color: var(--primary); font-size: 13px; }
.push-right { margin-left: auto; }
.count-pill { margin-left: auto; font-size: 11.5px; font-weight: 600; background: var(--accent-soft); border: 1px solid transparent; color: var(--accent-dark); border-radius: 999px; padding: 0 8px; }
.small-note { font-size: 12.5px; margin: 6px 0 0; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0; }
.stat-grid > div { background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 10px; display: flex; flex-direction: column-reverse; gap: 1px; }
.stat-grid dd { margin: 0; font-weight: 700; font-size: 18px; color: var(--ink); overflow-wrap: anywhere; }
.stat-grid dt { font-size: 11px; color: var(--muted); }
.detail-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.detail-list li { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.detail-list li span { color: var(--muted); flex: none; }
.detail-list li b { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.link-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.link-chips a { font-size: 12px; font-weight: 600; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; color: var(--ink-soft); }
.link-chips a:hover { border-color: var(--primary); color: var(--primary); }
.proj-mini { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.proj-mini a { color: var(--ink); font-size: 13.5px; }
.proj-mini a:hover { color: var(--primary); }
.proj-mini small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.profile-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 1100px) {
    .layout-profile { grid-template-columns: minmax(0, 1fr) 290px; }
    .layout-profile .col-right { display: flex; }
    .layout-profile .col-left { grid-column: 1 / -1; grid-row: 2; position: static; flex-direction: row; flex-wrap: wrap; }
    .layout-profile .col-left > * { flex: 1 1 280px; }
}
@media (max-width: 760px) {
    .layout-profile { grid-template-columns: minmax(0, 1fr); }
    .layout-profile .col-left, .layout-profile .col-right { display: flex; position: static; grid-column: auto; grid-row: auto; }
    .layout-profile .col-center { order: -1; }
}

/* ---- Projects ---- */
.layout-projects { max-width: 1500px; grid-template-columns: 270px minmax(0, 1fr) 330px; }
.layout-projects .col-left, .layout-projects .col-right { max-height: calc(100vh - var(--header-h) - 40px); overflow-y: auto; scrollbar-width: thin; }
.proj-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.proj-item { position: relative; display: block; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--ink); border: 1px solid transparent; }
.proj-item:hover { background: var(--surface-soft); }
.proj-item.is-active { background: var(--primary-soft); border-color: var(--primary); }
.proj-name { display: block; font-weight: 600; font-size: 13.5px; padding-right: 26px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-item small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.proj-item .count-badge.static { position: absolute; top: 9px; right: 8px; }
.dots { display: flex; gap: 4px; margin-top: 5px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.label-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.label-chip { display: inline-flex; align-items: center; border: 1px solid var(--lc, var(--line)); border-radius: 999px; overflow: hidden; background: var(--surface); }
.label-chip button { border: 0; background: none; padding: 2px 9px; font-size: 12px; font-weight: 600; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 5px; }
.label-chip button b { font-weight: 600; color: var(--muted); font-size: 11px; }
.label-chip .chip-x { padding: 2px 7px 2px 0; color: var(--muted); font-size: 10px; }
.label-chip.is-on { background: var(--lc); }
.label-chip.is-on button, .label-chip.is-on button b { color: #fff; }
.label-form { display: flex; gap: 6px; margin-top: 10px; }
.label-form input[type=text] { flex: 1; min-width: 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: 13px; }
.label-form input[type=color] { width: 34px; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.meter { height: 8px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.meter span { display: block; height: 100%; width: 1%; background: var(--accent); border-radius: 999px; transition: width .3s; }
.meter span.warn { background: var(--danger); }

.proj-centre { min-height: 0; }
.chat { display: flex; flex-direction: column; height: calc(100vh - var(--header-h) - 40px); min-height: 460px; overflow: hidden; position: relative; }
.chat.drop::after { content: "Drop files to attach"; position: absolute; inset: 0; background: rgba(3, 48, 74, .12); border: 2px dashed var(--primary); border-radius: var(--radius); display: grid; place-items: center; font-weight: 700; color: var(--primary); z-index: 4; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-title { display: flex; flex-direction: column; min-width: 0; }
.chat-title strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-title small { color: var(--muted); font-size: 12px; }
#chatToggleInfo { display: none; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 14px 16px; background: var(--surface-soft); scrollbar-width: thin; }
.chat-older { display: block; margin: 0 auto 10px; }
.chat-empty { text-align: center; margin: 40px 0; }
.msg-day { text-align: center; margin: 14px 0 8px; }
.msg-day span { font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px; }
.msg-system { text-align: center; margin: 8px 0; font-size: 12px; color: var(--muted); }
.msg { display: flex; gap: 8px; margin: 8px 0; align-items: flex-start; max-width: 100%; }
.msg.mine { flex-direction: row-reverse; }
.bubble { max-width: min(78%, 620px); background: var(--surface); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 7px 12px 9px; min-width: 120px; }
.msg.mine .bubble { background: var(--primary-soft); border-color: transparent; border-radius: 14px 4px 14px 14px; }
.bubble-head { display: flex; align-items: baseline; gap: 8px; font-size: 12px; }
.bubble-head a { font-weight: 700; color: var(--ink); }
.bubble-head time { color: var(--muted); font-size: 11px; }
.msg-del { margin-left: auto; opacity: 0; font-size: 11px; }
.bubble:hover .msg-del, .msg-del:focus-visible { opacity: 1; }
.bubble-text { font-size: 13.5px; line-height: 1.5; margin-top: 3px; overflow-wrap: anywhere; }
.bubble-text a { text-decoration: underline; }
.chat-imgs { display: grid; gap: 4px; margin-top: 6px; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 380px; }
.chat-imgs.n1 { grid-template-columns: minmax(0, 260px); }
.chat-img { display: block; border-radius: 8px; overflow: hidden; background: var(--line); aspect-ratio: 4 / 3; }
.chat-imgs.n1 .chat-img { aspect-ratio: auto; }
.chat-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-imgs.n1 .chat-img img { height: auto; max-height: 300px; object-fit: contain; }
.chat-files { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
.chat-file { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); max-width: 340px; }
.chat-file:hover { border-color: var(--primary); }
.chat-file > .fa-solid:first-child { color: var(--primary); font-size: 18px; }
.chat-file span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-file strong { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-file small { color: var(--muted); font-size: 11px; }
.chat-composer { border-top: 1px solid var(--line); padding: 10px 12px 8px; background: var(--surface); }
.chat-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-row textarea { flex: 1; resize: none; min-height: 38px; max-height: 160px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); line-height: 1.4; }
.chat-row textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
.chat-hint { display: block; margin-top: 5px; font-size: 11px; }
.chat-previews { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chat-previews .prev { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 3px 4px 3px 6px; background: var(--surface-soft); max-width: 200px; font-size: 12px; }
.chat-previews .prev img { width: 28px; height: 28px; object-fit: cover; border-radius: 5px; }
.chat-previews .prev em { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-previews .prev button { border: 0; background: none; color: var(--muted); padding: 2px 4px; }
.chat-locked, .chat-empty-state, .invite-card { padding: 32px 24px; text-align: center; }
.chat-empty-state h2, .chat-locked h2 { margin: 6px 0; font-size: 20px; }
.invite-card { text-align: left; margin-bottom: 14px; border-color: var(--primary); }
.invite-card h2 { margin: 4px 0 6px; font-size: 20px; }
.invite-card blockquote { margin: 10px 0; padding: 8px 14px; border-left: 3px solid var(--primary); background: var(--surface-soft); border-radius: 0 8px 8px 0; font-size: 13.5px; }
.invite-actions { display: flex; gap: 10px; margin-top: 14px; }
.eyebrow { font-size: 12px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .04em; margin: 0; }

.detail-title { margin: 0 0 4px; font-size: 16px; line-height: 1.3; }
.detail-summary { margin: 0 0 10px; color: var(--ink-soft); font-size: 13px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.pill { font-size: 11.5px; font-weight: 600; border: 1px solid var(--line); background: var(--surface-soft); color: var(--ink-soft); border-radius: 999px; padding: 1px 9px; }
.pill-active { color: var(--success); border-color: var(--success); } .pill-completed { color: var(--primary); border-color: var(--primary); } .pill-paused { color: var(--warning); border-color: var(--warning); }
.detail-block { margin-top: 12px; }
.detail-block h3, .mini-h { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.detail-desc { font-size: 13px; line-height: 1.55; max-height: 220px; overflow-y: auto; overflow-wrap: anywhere; }
.danger-outline { margin-top: 14px; color: var(--danger); border-color: var(--danger); }
.danger-outline:hover { background: var(--bad-soft); }
.role-tag { font-size: 11px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.role-owner, .role-lead { color: var(--primary); border-color: var(--primary); }
.role-select { font-size: 12px; padding: 3px 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); max-width: 108px; }
.invite-form { display: flex; flex-direction: column; gap: 10px; }
.invite-form .field textarea { min-height: 70px; }
.pending-list { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.pending-list li { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
#pendingInvites { margin-top: 14px; }
.modal-lightbox figure { position: relative; margin: 0; max-width: 94vw; max-height: 92vh; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.modal-lightbox img { max-width: 94vw; max-height: 84vh; border-radius: 8px; background: #fff; }
.modal-lightbox figcaption { color: #fff; font-size: 13px; }
.modal-lightbox .modal-close { position: fixed; top: 16px; right: 16px; }

@media (max-width: 1180px) {
    .layout-projects { grid-template-columns: 250px minmax(0, 1fr); }
    .layout-projects .col-right { grid-column: 1 / -1; position: static; max-height: none; display: none; flex-direction: row; flex-wrap: wrap; }
    .layout-projects .col-right.is-open { display: flex; }
    .layout-projects .col-right > * { flex: 1 1 280px; }
    #chatToggleInfo { display: inline-flex; }
}
@media (max-width: 760px) {
    .layout-projects { grid-template-columns: minmax(0, 1fr); }
    .layout-projects .col-left { position: static; max-height: none; }
    .chat { height: calc(100vh - var(--header-h) - 24px); }
    .bubble { max-width: 88%; }
}

[hidden] { display: none !important; }
@media (max-width: 760px) {
    .layout-projects .col-left { display: flex; order: 2; }
    .layout-projects .col-center { order: 1; }
    .layout-projects .col-right { order: 3; }
}
.profile-hero .profile-card-cover.tall { display: block; }

/* ---- Shared side blocks ---- */
.community-head { padding: 16px 20px; }
.community-head .eyebrow { margin: 0 0 4px; }
.community-head h1 { margin: 0 0 2px; font-size: 22px; }
.community-head p.muted { margin: 0; font-size: 13.5px; }
.collab-card .small-note { margin: 0 0 12px; }
.principles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; font-size: 12.5px; color: var(--ink-soft); line-height: 1.45; }
.principles strong { color: var(--ink); }
.guidelines h2 { font-size: 17px; margin: 20px 0 4px; }
.guidelines p { margin: 0 0 6px; }
.eyebrow { font-size: 12px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .04em; }

/* ---- Post modal / page: images always fit the available height, no vertical scrolling ---- */
.carousel-track { overflow-y: hidden; }
.carousel-slide { position: relative; min-height: 0; overflow: hidden; }
.carousel-slide img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; }

/* ---- Project statistics: one row of small cards above the chat ---- */
.proj-stats { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
.proj-stats[hidden] { display: none; }
.stat-mini { flex: 1 1 0; min-width: 104px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.stat-mini .fa-solid { color: var(--primary); font-size: 13px; }
.stat-mini span { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.stat-mini b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-mini small { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.chat { height: calc(100vh - var(--header-h) - 100px); }

/* ---- Settings ---- */
.layout-settings { max-width: 1200px; grid-template-columns: 240px minmax(0, 1fr) 300px; }
.settings-nav { display: flex; flex-direction: column; padding: 8px; }
.settings-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--ink-soft); font-weight: 600; font-size: 13.5px; }
.settings-nav a:hover { background: var(--surface-soft); color: var(--primary); }
.settings-nav .fa-solid { width: 16px; color: var(--primary); text-align: center; }
.settings-card { padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; scroll-margin-top: calc(var(--header-h) + 16px); }
.settings-card h2 { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.settings-card h2 .fa-solid { color: var(--primary); font-size: 15px; }
.settings-card h3 { margin: 6px 0 0; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.settings-card > p { margin: 0; font-size: 13.5px; }
.settings-foot { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 4px; }
.switch { display: flex; align-items: center; gap: 12px; font-size: 14px; cursor: pointer; padding: 4px 0; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background .15s; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:focus-visible { box-shadow: var(--focus); }
.sx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.sx-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink); background: var(--surface-soft); }
.sx-item:hover { border-color: var(--primary); }
.sx-item > .fa-solid:first-child { color: var(--primary); font-size: 18px; width: 22px; text-align: center; }
.sx-item span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sx-item strong { font-size: 13.5px; } .sx-item small { color: var(--muted); font-size: 11.5px; }
.sx-item > .fa-solid:last-child { color: var(--muted); font-size: 11px; }
@media (max-width: 1020px) { .layout-settings { grid-template-columns: minmax(0, 1fr); } .layout-settings .col-left, .layout-settings .col-right { display: flex; position: static; } .settings-nav { flex-direction: row; flex-wrap: wrap; } }

/* ---- Confirmation dialog ---- */
.confirm-modal { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center; padding: 16px; }
.confirm-dialog { max-width: 400px; padding: 26px 24px 20px; text-align: center; overflow: visible; }
.confirm-dialog h2 { margin: 10px 0 6px; font-size: 18px; }
.confirm-dialog p { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.confirm-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; background: var(--bad-soft); color: var(--danger); font-size: 22px; }
.confirm-icon.info { background: var(--primary-soft); color: var(--primary); }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.confirm-actions .btn { min-width: 120px; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { filter: brightness(.92); color: #fff; }
:root[data-theme="dark"] .btn-danger { color: #1a0b0a; }

/* ---- Phone input with country dial code ---- */
.phone-wrap { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.phone-wrap:focus-within { border-color: var(--primary); box-shadow: var(--focus); }
.phone-prefix { display: grid; place-items: center; padding: 0 10px; background: var(--surface-soft); border-right: 1px solid var(--line); color: var(--ink-soft); font-weight: 600; font-size: 13px; min-width: 44px; }
.phone-wrap input { border: 0 !important; box-shadow: none !important; flex: 1; min-width: 0; border-radius: 0 !important; }

/* ---- Searchable select (assets/js/select.js) ---- */
.ss { position: relative; display: block; min-width: 0; font-weight: 400; }
.ss.role-select { display: inline-block; padding: 0; border: 0; background: none; max-width: 120px; }
.ss-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; left: 0; bottom: 0; }
.ss-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; min-height: 40px; text-align: left; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; cursor: pointer; }
.ss-btn:hover { border-color: var(--muted-light); }
.ss-btn:focus-visible, .ss.is-open .ss-btn { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
.ss-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-label.is-placeholder { color: var(--muted); }
.ss-caret { font-size: 11px; color: var(--muted); transition: transform .15s; }
.ss.is-open .ss-caret { transform: rotate(180deg); }
.ss.is-disabled .ss-btn { opacity: .55; cursor: not-allowed; }
.ss.role-select .ss-btn, .ss.role-select .ss-btn { padding: 3px 8px; min-height: 28px; font-size: 12px; border-radius: 6px; }
.field-sm .ss-btn { padding-right: 10px; }
.ss-panel { position: fixed; z-index: 600; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-heavy); max-width: min(420px, calc(100vw - 16px)); display: flex; flex-direction: column; overflow: hidden; animation: pop .12s ease-out; }
.ss-search { margin: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); color: var(--ink); font: inherit; font-size: 13px; }
.ss-search:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); background: var(--surface); }
.ss-list { list-style: none; margin: 0; padding: 0 4px 6px; overflow-y: auto; scrollbar-width: thin; }
.ss-opt { padding: 8px 10px; border-radius: 6px; font-size: 13.5px; cursor: pointer; color: var(--ink); }
.ss-opt.is-active { background: var(--primary-soft); }
.ss-opt.is-selected { font-weight: 700; color: var(--primary); }
.ss-opt.is-disabled { opacity: .45; cursor: not-allowed; }
.ss-group { padding: 8px 10px 3px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ss-empty { padding: 14px 10px; text-align: center; color: var(--muted); font-size: 13px; }


/* Brand accents (orange from the logo) */
.nav-item.is-active { box-shadow: inset 0 -3px 0 var(--accent); }
.btn-accent { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.btn-accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
:root[data-theme="dark"] .btn-accent, :root[data-theme="dark"] .btn-accent:hover { color: #1d0d03; }
::selection { background: var(--accent-soft); color: var(--ink); }

/* Logo lockup: icon + live Montserrat wordmark (navy / orange, light on dark) */
.brand { gap: 9px; }
.brand-mark { width: 36px; height: 36px; border-radius: 9px; background: #fff; padding: 2px; }
.brand-text { font-weight: 800; font-size: 19px; letter-spacing: -.01em; color: var(--primary); white-space: nowrap; }
.brand-text b { color: var(--accent); font-weight: 800; }
.brand:hover { text-decoration: none; }

/* Ecosystem top bar (hidden on mobile) */
.topbar { background: var(--primary); color: #fff; font-size: 12.5px; }
.topbar-inner { max-width: var(--site-width); margin: 0 auto; padding: 7px 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.topbar a { color: #fff; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(255,255,255,.4); text-underline-offset: 3px; }
.topbar a:hover { text-decoration-color: var(--accent); }
.topbar-right { color: #fff; font-weight: 700; }
.topbar-right::after { content: " \2192"; color: var(--accent); }
:root[data-theme="dark"] .topbar { background: #0a2a3d; border-bottom: 1px solid var(--line); }
@media (max-width: 768px) { .topbar { display: none; } }

/* Upgrade storage modal */
.plan-list { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 14px; }
.plan-card { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; flex-wrap: wrap; }
.plan-card.is-on { border-color: var(--accent); background: var(--accent-soft); }
.plan-card input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.plan-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 160px; }
.plan-main small { color: var(--muted); font-size: 12.5px; }
.plan-price { font-weight: 800; font-size: 20px; color: var(--primary); text-align: right; display: flex; flex-direction: column; }
.plan-price small { font-size: 11.5px; font-weight: 500; color: var(--muted); }
#stAddonCard { cursor: default; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper input { width: 64px; text-align: center; padding: 8px 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; }
.stepper-unit { color: var(--muted); font-size: 13px; }
.plan-summary { margin: 0 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); }
.plan-summary > div { display: flex; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.plan-summary > div:last-child { border-bottom: 0; }
.plan-summary dt { color: var(--muted); } .plan-summary dd { margin: 0; font-weight: 700; }
.plan-summary .total dt { color: var(--ink); font-weight: 700; } .plan-summary .total dd { font-size: 19px; color: var(--primary); }

/* My files (folders + files library) */
.lib-card { padding: 0; margin-bottom: 12px; overflow: hidden; }
.lib-card.drop { outline: 2px dashed var(--accent); outline-offset: -4px; }
.lib-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; flex-wrap: wrap; }
.lib-toggle { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; color: var(--ink); font: inherit; padding: 6px 4px; cursor: pointer; }
.lib-toggle i:first-child { color: var(--accent); }
.lib-toggle i:last-child { transition: transform .15s; color: var(--muted); }
.lib-card.is-open .lib-toggle i:last-child { transform: rotate(180deg); }
.lib-actions { display: flex; gap: 8px; }
.lib-body { border-top: 1px solid var(--line); padding: 12px; max-height: 340px; overflow-y: auto; }
.lib-newform { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.lib-newform input { flex: 1; min-width: 160px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; }
.lib-crumbs { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.lib-crumbs button { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; }
.lib-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-bottom: 8px; }
.lib-folder { position: relative; display: flex; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); }
.lib-folder:hover { border-color: var(--accent); }
.lib-folder-open { flex: 1; display: flex; align-items: center; gap: 10px; background: none; border: 0; color: var(--ink); font: inherit; padding: 9px 10px; text-align: left; cursor: pointer; min-width: 0; }
.lib-folder-open i { color: var(--accent); font-size: 20px; }
.lib-folder-open span { display: flex; flex-direction: column; min-width: 0; }
.lib-folder-open strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.lib-folder-open small, .lib-fname small { color: var(--muted); font-size: 11.5px; }
.lib-x { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px 9px; border-radius: 6px; }
.lib-x:hover { color: var(--danger); background: var(--bad-soft); }
.lib-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lib-file { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.lib-file:last-child { border-bottom: 0; }
.lib-thumb, .lib-ico { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; flex: none; background: var(--surface-soft); display: grid; place-items: center; color: var(--muted); }
.lib-fname { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.lib-fname a, .lib-fname strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.lib-pick { display: flex; align-items: center; gap: 10px; flex: 1; cursor: pointer; min-width: 0; }
.lib-pick input { width: 17px; height: 17px; accent-color: var(--accent); }
.lib-empty { text-align: center; padding: 8px 0; }
#libPicker .modal-body { max-height: 60vh; overflow-y: auto; }
#libPicker .modal-foot { align-items: center; }
#libPicker .modal-foot .muted { margin-right: auto; }

/* My files in the right panel (narrow) */
.proj-right .lib-card { margin-bottom: 0; }
.proj-right .lib-folders { grid-template-columns: 1fr; }
.proj-right .lib-body { max-height: 320px; }
.proj-right .lib-head { padding: 8px 10px; }
.proj-right .lib-actions { width: 100%; }
.proj-right .lib-actions .btn { flex: 1; justify-content: center; }
.proj-right .lib-file [data-lib-att] { padding: 5px 8px; }
.proj-right > *, .proj-left > * { flex-shrink: 0; }

/* ---- Post modal: one scroll. The image slider scrolls away with the post as you read down ---- */
.pm-main { overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; }
.pm-main .carousel { flex: 0 0 auto; height: 72vh; min-height: 280px; max-height: 760px; }
.pm-main .pm-detail { flex: 0 0 auto; max-height: none; overflow: visible; }
.pm-main:not(:has(.carousel)) .pm-detail { flex: 1 0 auto; }
@media (max-width: 760px) { .pm-main .carousel { height: 56vh; } .pm-main .pm-detail { max-height: none; } }

/* invite card */
.inv-form { display: flex; flex-direction: column; gap: 10px; }
.inv-form .small-note { margin: 0; text-align: center; }
.invite-note { margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--ok-soft); color: var(--success); font-weight: 600; font-size: 14px; }

/* ---------- company pages ---------- */
.page-narrow.co-wide { max-width: 980px; }
.co-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 22px 24px; margin-bottom: 14px; flex-wrap: wrap; }
.co-head h1 { margin: 2px 0 6px; font-size: 24px; }
.co-head .muted { margin: 0; max-width: 620px; }
.co-head-cta { display: flex; gap: 8px; flex-wrap: wrap; }
.co-filter { display: flex; gap: 8px; padding: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.co-filter input[type=search] { flex: 1 1 220px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.co-filter select { padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.co-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.co-card { flex: 1 1 280px; max-width: calc(33.333% - 10px); min-width: 250px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px; text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; }
.co-card:hover { box-shadow: var(--shadow-md, 0 6px 18px rgba(3,48,74,.12)); transform: translateY(-1px); }
.co-card strong { font-size: 16px; }
.co-tag { font-size: 13.5px; }
.co-counts { color: var(--primary); font-weight: 600; margin-top: auto; }
.co-logo { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 12px; background: var(--primary); color: #fff; font-weight: 700; overflow: hidden; flex: 0 0 auto; }
.co-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.co-logo-lg { width: 88px; height: 88px; font-size: 26px; border-radius: 16px; border: 1px solid var(--line); }
.co-logo-prev { display: block; width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-bottom: 6px; }
.verified-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--success); background: var(--ok-soft); padding: 2px 9px; border-radius: 999px; }
.co-pager { display: flex; gap: 8px; justify-content: center; margin: 18px 0; }
.co-hero { display: flex; gap: 20px; align-items: center; padding: 24px; margin-bottom: 14px; flex-wrap: wrap; }
.co-hero-main { flex: 1 1 280px; min-width: 0; }
.co-hero-main h1 { margin: 0 8px 4px 0; font-size: 26px; display: inline; }
.co-tagline { margin: 8px 0 4px; font-size: 16px; }
.co-meta { margin: 2px 0 0; font-size: 13.5px; }
.co-hero-cta { display: flex; gap: 8px; flex-wrap: wrap; }
.co-about { margin-bottom: 14px; } .co-about h2 { margin-top: 0; font-size: 17px; }
.co-h2 { font-size: 19px; margin: 22px 2px 10px; }
.co-items { display: flex; flex-wrap: wrap; gap: 14px; }
.co-item { flex: 1 1 280px; max-width: calc(50% - 7px); overflow: hidden; display: flex; flex-direction: column; }
.co-item-img { width: 100%; height: 190px; object-fit: cover; background: var(--surface-2, #f3f6f8); }
.co-item-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.co-item-body h3 { margin: 0; font-size: 16px; } .co-item-body p { margin: 0; font-size: 14px; }
.co-kind { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--primary); }
.co-banner { padding: 12px 16px; margin-bottom: 14px; background: var(--ok-soft); }
.co-section { margin-bottom: 14px; } .co-section h2 { margin: 0 0 12px; font-size: 18px; }
.co-status { margin: 4px 0 10px; font-weight: 600; } .co-status-verified { color: var(--success); } .co-status-rejected, .co-status-suspended { color: var(--danger); }
.co-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; }
.co-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.co-list li .muted { flex: 1 1 240px; font-size: 13px; }
.co-row-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.co-row-actions input { padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); min-width: 160px; }
.co-ad-approved { color: var(--success); } .co-ad-rejected, .co-ad-stopped { color: var(--danger); }
.link-btn.danger { color: var(--danger); }
.co-actions { display: flex; gap: 8px; }
@media (max-width: 760px) { .co-card, .co-item { max-width: 100%; flex-basis: 100%; } .co-row-actions { margin-left: 0; } }

/* From Science Catalogs card */
.sc-card .sc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sc-card .sc-list li a { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; font-size: 14px; font-weight: 500; }
.sc-card .sc-list li:last-child a { border-bottom: 0; padding-bottom: 0; }
.sc-card .sc-list li a:hover { color: var(--primary); }
.sc-card .sc-list .fa-solid { width: 18px; text-align: center; color: var(--primary); }
.side-ad-top { margin-bottom: 0; }

#sideAd.side-ad-top .ad-card { border: 1px solid var(--primary); box-shadow: 0 4px 16px rgba(3,48,74,.14); }
#sideAd.side-ad-top .ad-img { height: 170px; object-fit: cover; }
#sideAd.side-ad-top h3 { font-size: 16px; }

/* identity-verified mark (certificate seal) */
.vbadge { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 1.05em; height: 1.05em; margin-left: 4px; vertical-align: -0.12em; font-size: 0.95em; color: var(--verified, #1b7fb8); flex: 0 0 auto; }
.vbadge .fa-certificate { font-size: 1em; }
.vbadge .fa-check { position: absolute; font-size: 0.46em; color: #fff; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.id-card .id-steps { margin: 0 0 14px; padding-left: 18px; color: var(--muted); font-size: 14px; }
.profile-card > .btn { width: calc(100% - 28px); margin: 0 14px 12px; }

/* jobs */
.job-list { display: flex; flex-direction: column; gap: 10px; }
.job-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; text-decoration: none; color: inherit; }
.job-card:hover { box-shadow: 0 6px 18px rgba(3,48,74,.12); }
.job-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.job-main strong { font-size: 16px; }
.job-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; padding: 0; }
.job-tags span { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-2, #eef3f6); color: var(--primary); border: 1px solid var(--line); }
.job-when { align-self: flex-start; white-space: nowrap; }
.app-note { flex-basis: 100%; padding: 8px 12px; border-left: 3px solid var(--line); background: var(--surface-2, #f4f7f9); border-radius: 4px; }
.co-section select, .co-row-actions select { padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.field-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 760px) { .field-grid-3 { grid-template-columns: 1fr; } .job-card { flex-wrap: wrap; } }

/* ---------- admin dashboard ---------- */
.ad-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; margin-bottom: 12px; }
.ad-tabs a { padding: 8px 14px; border-radius: 8px; color: inherit; text-decoration: none; font-weight: 600; }
.ad-tabs a:hover { background: rgba(127,127,127,.12); }
.ad-tabs a.is-active { background: var(--primary, #1a56db); color: #fff; }
.ad-pill { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 9px; background: #d92d20; color: #fff; font-size: 12px; text-align: center; }
.ad-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.ad-tile { flex: 1 1 200px; display: flex; flex-direction: column; gap: 4px; }
.ad-tile strong { font-size: 28px; line-height: 1.1; }
.ad-chart { margin-bottom: 12px; }
.ad-chart h2 { font-size: 16px; margin: 0 0 12px; }
.ad-bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.ad-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.ad-bar i { display: block; width: 100%; background: var(--primary, #1a56db); border-radius: 3px 3px 0 0; opacity: .85; }
.ad-bar span { font-size: 11px; color: #667085; }
.ad-search { display: flex; gap: 8px; margin-bottom: 12px; }
.ad-search input[type=search] { flex: 1; min-width: 0; }
.ad-health { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ad-dot { width: 10px; height: 10px; border-radius: 50%; background: #98a2b3; flex: none; }
.ad-dot.ok { background: #12b76a; } .ad-dot.warn { background: #f79009; }
.ad-log { margin: 0; padding: 12px; max-height: 280px; overflow: auto; font-size: 12px; white-space: pre-wrap; word-break: break-word; background: rgba(127,127,127,.1); border-radius: 8px; }

/* ---------- company accounts, people ---------- */
.co-gst-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--border, #d0d5dd); border-radius: 10px; background: rgba(18,183,106,.08); }
.co-gst-card strong { font-size: 18px; }
.co-field-btn { display: flex; align-items: flex-end; }
.co-h3 { font-size: 16px; margin: 8px 0 0; }
.co-people { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.co-claim { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 12px; }
.co-claim .field { flex: 1 1 240px; }

/* ---------- Company posts and reposts ---------- */
.badge.repost { background: #e6f3fb; color: #0b5f8a; display: inline-flex; align-items: center; gap: 4px; }
.badge.company { background: #fff2e6; color: #a54b00; display: inline-flex; align-items: center; gap: 4px; order: 0; }
:root[data-theme="dark"] .badge.repost { background: #13303f; color: #8ccdf0; }
:root[data-theme="dark"] .badge.company { background: #3a2412; color: #f2b27a; }
.repost-embed { display: block; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); color: var(--ink); text-decoration: none !important; cursor: pointer; transition: border-color .15s; }
.repost-embed:hover, .repost-embed:focus-visible { border-color: var(--primary); outline: 0; }
.repost-embed.is-gone { cursor: default; color: var(--muted); font-size: 13.5px; display: flex; gap: 8px; align-items: center; }
.repost-embed__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.repost-embed__head > span { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; }
.repost-embed__head strong { font-size: 13.5px; }
.repost-embed__head small { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.repost-embed__img { display: block; width: 100%; max-height: 260px; object-fit: cover; border-radius: 8px; margin: 4px 0 8px; background: var(--line); }
.repost-embed__title { display: block; font-size: 15px; line-height: 1.35; margin-bottom: 4px; }
.repost-embed__text { display: block; margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.repost-embed__link { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.post-repost > .post-body { margin-bottom: 0; }
.modal-repost { max-width: 560px; width: 100%; }
.modal-repost textarea { width: 100%; resize: vertical; min-height: 96px; font: inherit; }
.modal-repost [data-slot="repost-preview"] .repost-embed { cursor: default; margin-top: 4px; }
.modal-repost .modal-foot { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- Company page (3 columns), contact, Startup Showcase (2026-10-10) ---------- */
.field-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.link-btn.danger, .btn.danger { color: var(--danger); }
.layout-company { max-width: 1400px; grid-template-columns: 260px minmax(0, 1fr) 310px; }
.layout-company .col-left, .layout-company .col-right { max-height: calc(100vh - var(--header-h) - 40px); overflow-y: auto; scrollbar-width: thin; }
.layout-company .co-hero, .layout-company .co-about, .layout-company .co-banner { margin-bottom: 0; }
.layout-company .co-h2 { margin: 8px 2px 0; }
.co-facts dl { margin: 0; display: flex; flex-direction: column; }
.co-facts dl div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.co-facts dt { color: var(--muted); flex: none; }
.co-facts dd { margin: 0; text-align: right; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.co-jump { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.co-jump a { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.co-jump a:hover { background: var(--line); }
.co-more { margin-top: 10px; }
.co-people-list li[hidden] { display: none; }
.layout-company .co-claim { flex-direction: column; align-items: stretch; }
.layout-company .co-claim .field { flex: none; }
.co-invite { padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; border-color: var(--secondary); background: var(--primary-soft); }
.co-invite p { margin: 0; flex: 1 1 320px; }
.co-gate { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.co-gate h1 { margin: 8px 0 0; font-size: 24px; }
.co-gate p { margin: 0; }
.co-gate-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.co-gate-cta { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 8px 0 4px; }
.co-head-link { margin: 10px 0 0; font-weight: 600; }
.co-from { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-soft); border: 1px solid var(--line); }
.co-from span { display: flex; flex-direction: column; min-width: 0; }
.co-from small { color: var(--muted); overflow-wrap: anywhere; }
.co-count { display: block; text-align: right; font-size: 11.5px; }
.modal-contact { max-width: 560px; }
.co-checks { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.co-checks legend { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; padding: 0; }
.co-checks .check { align-items: center; }
.co-invite-form { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.ad-msg { flex: 1 1 100%; font-size: 13px; padding: 10px 12px; background: var(--surface-soft); border-radius: var(--radius-sm); white-space: normal; overflow-wrap: anywhere; }
.st-badge { color: #a14a00; background: #fff1e5; }
:root[data-theme="dark"] .st-badge { color: #f4b37a; background: #3a2414; }
.co-startup-teaser { display: flex; gap: 14px; align-items: center; padding: 14px; text-decoration: none; color: inherit; transition: box-shadow .15s; }
.co-startup-teaser:hover { box-shadow: 0 6px 18px rgba(3, 48, 74, .12); }
.co-startup-teaser > span:last-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.co-startup-teaser .muted { font-size: 13px; }
.st-thumb { position: relative; flex: 0 0 150px; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; background: #000; }
.st-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-thumb i, .st-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 26px; text-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.st-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 26px 24px; margin-bottom: 14px; flex-wrap: wrap;
  background: linear-gradient(120deg, var(--primary-soft), var(--surface) 70%); }
.st-hero h1 { margin: 4px 0 6px; font-size: 26px; }
.st-hero .muted { margin: 0; max-width: 640px; }
.st-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.st-card { flex: 1 1 290px; max-width: calc(33.333% - 10px); min-width: 260px; display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; }
.st-card:hover { box-shadow: 0 6px 18px rgba(3, 48, 74, .12); transform: translateY(-1px); }
.st-media { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--primary-soft); }
.st-media > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-media-logo { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700; color: var(--primary); }
.st-media-logo img { max-width: 45%; max-height: 60%; object-fit: contain; }
.st-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1; }
.st-title { display: flex; align-items: center; gap: 10px; }
.st-title .co-logo { width: 34px; height: 34px; border-radius: 8px; font-size: 13px; }
.st-title strong { font-size: 16px; }
.st-brief { font-size: 13.5px; color: var(--ink-soft); }
.st-founders { display: flex; align-items: center; gap: 4px; margin-top: auto; padding-top: 6px; }
.st-founders .avatar { width: 26px; height: 26px; font-size: 10px; }
.st-founders small { color: var(--muted); margin-left: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.st-chips span { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--success); }
.st-chips-lg span { font-size: 13px; padding: 4px 12px; }
.st-how { margin-top: 18px; }
.st-how h2 { margin: 0 0 8px; font-size: 18px; }
.st-how ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.st-crumbs { font-size: 13px; color: var(--muted); margin: 0 2px 10px; }
.st-page .co-about { margin-bottom: 14px; }
.st-story p { font-size: 15px; line-height: 1.65; }
.st-video { overflow: hidden; margin-bottom: 14px; }
.st-video-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.st-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.st-people { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.st-person { flex: 1 1 200px; max-width: calc(25% - 9px); min-width: 180px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 18px 14px; }
.st-person .avatar-lg { width: 64px; height: 64px; font-size: 20px; margin-bottom: 4px; }
.st-person-name { font-weight: 700; color: var(--ink); }
.st-person small { color: var(--muted); }
.st-person .sid-chip { align-self: center; margin: 2px 0 6px; }
@media (max-width: 1100px) {
  .layout-company { grid-template-columns: minmax(0, 1fr) 290px; }
  .layout-company .col-right { display: flex; }
  .layout-company .col-left { grid-column: 1 / -1; grid-row: 2; position: static; max-height: none; flex-direction: row; flex-wrap: wrap; }
  .layout-company .col-left > * { flex: 1 1 280px; }
  .st-card { max-width: calc(50% - 7px); }
  .st-person { max-width: calc(33.333% - 8px); }
}
@media (max-width: 760px) {
  .layout-company { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .layout-company .col-left, .layout-company .col-right { display: flex; position: static; max-height: none; grid-column: auto; grid-row: auto; }
  .layout-company .col-center { order: -1; }
  .field-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .st-card, .st-person { max-width: 100%; }
  .co-startup-teaser { flex-direction: column; align-items: stretch; }
  .st-thumb { flex-basis: auto; }
}

/* ---------- Company dashboard cards, products grid, moderators, ads dashboard ---------- */
[data-person-search][hidden], .co-tile[hidden] { display: none !important; }
.co-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.co-card-head h2, .co-card-head .side-title { margin: 0; }
.co-card-head h2 .muted { font-weight: 500; font-size: 14px; }
.co-h4 { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 14px 0 4px; }
.co-dash .co-section { margin-bottom: 0; }
.co-dash-tiles { margin-bottom: 0; }
.co-dash-tiles .ad-tile { flex-basis: 140px; text-decoration: none; color: inherit; }
.co-dash-company { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.co-dash-company h1 { font-size: 18px; margin: 4px 0 0; }
.co-dash-company .co-status { margin: 2px 0; font-size: 13px; }
.co-logo-md { width: 60px; height: 60px; font-size: 20px; border-radius: 14px; border: 1px solid var(--line); }
.co-dash-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.co-mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 10px; }
.co-mini-stats div { background: var(--surface-soft); border-radius: var(--radius-sm); padding: 6px 4px; text-align: center; }
.co-mini-stats dt { font-size: 10.5px; color: var(--muted); }
.co-mini-stats dd { margin: 0; font-weight: 700; font-size: 15px; }
.co-rights { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.co-rights span { font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); }
.co-search { width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); margin-bottom: 4px; }
.co-req-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.co-team-select { padding: 4px 6px; font-size: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
.co-dash .suggest { flex-wrap: wrap; }
.co-msg-list { list-style: none; margin: 0; padding: 0; }
.co-msg-list li { border-top: 1px solid var(--line); padding: 10px 0; }
.co-msg-list summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.co-msg-list summary .muted { font-size: 13px; }
.co-msg-list p { margin: 10px 0; white-space: normal; overflow-wrap: anywhere; font-size: 14px; }
.co-item-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(max(100px, calc((100% - 60px) / 6)), 1fr)); }
.co-tile { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); min-width: 0; transition: box-shadow .15s; }
.co-tile:hover { box-shadow: 0 4px 14px rgba(3, 48, 74, .1); }
.co-tile-open { display: block; padding: 0; border: 0; background: var(--surface-soft); aspect-ratio: 4 / 3; cursor: pointer; width: 100%; }
.co-tile-open img { width: 100%; height: 100%; object-fit: cover; display: block; }
.co-tile-ph { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; color: var(--primary); font-size: 26px; opacity: .55; }
.co-tile-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.co-tile-body strong { font-size: 13.5px; line-height: 1.3; overflow-wrap: anywhere; }
.co-tile-body small { font-size: 12px; color: var(--muted); }
.co-tile-body .co-kind { font-size: 10px; }
.co-tile-actions { display: flex; gap: 10px; margin-top: 6px; }
.co-grid-more { margin-top: 12px; }
.modal-item { max-width: 560px; }
.co-item-modal-img { width: 100%; max-height: 300px; object-fit: contain; background: var(--surface-soft); border-radius: var(--radius-sm); }
.modal-wide { max-width: 820px; }
.co-checks-col { flex-direction: column; }
.co-mod-name { font-weight: 700; margin: 0; }
.co-facts-dl { margin: 8px 0; display: flex; flex-direction: column; }
.co-facts-dl div { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.co-facts-dl dt { color: var(--muted); } .co-facts-dl dd { margin: 0; font-weight: 600; text-align: right; }
.co-startup-video { position: relative; display: block; border-radius: var(--radius-sm); overflow: hidden; background: #0b1620; aspect-ratio: 16 / 9; margin: 8px 0; text-decoration: none; }
.co-startup-video img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .85; }
.co-startup-video span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; color: #fff; font-weight: 700; text-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.co-startup-card .st-badge { margin-top: 2px; }
.co-ad-table { display: flex; flex-direction: column; }
.co-ad-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 70px 70px 80px 50px; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.co-ad-headrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-top: 0; padding-top: 0; }
.co-ad-main { display: flex; gap: 10px; align-items: center; min-width: 0; }
.co-ad-main img { width: 56px; height: 40px; object-fit: cover; border-radius: 6px; flex: none; }
.co-ad-main span { display: flex; flex-direction: column; min-width: 0; }
.co-ad-main small { font-size: 12px; }
@media (max-width: 760px) {
  .co-ad-row { grid-template-columns: minmax(0, 1fr) auto; }
  .co-ad-row > span:nth-child(n+3):not(:last-child) { display: none; }
  .co-ad-headrow { display: none; }
  .co-item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
