/* ==========================================================================
   Barterific — front-end stylesheet
   Gray surfaces, purple accent, soft cards, separate light/dark themes.
   ========================================================================== */

:root {
    --bg: #f1f1f5;
    --bg-soft: #e8e8ef;
    --surface: #ffffff;
    --surface-2: #fafafc;
    --surface-3: #f4f4f8;
    --text: #17171c;
    --text-2: #55555f;
    --muted: #86868f;
    --border: #e4e4ec;
    --border-strong: #d3d3de;
    --accent: #7c5cfc;
    --accent-ink: #5738e6;
    --accent-soft: #efeafd;
    --accent-soft-2: #ded2fd;
    --ok: #1f9d63;
    --warn: #b7791f;
    --danger: #d1374a;
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 26px;
    --shadow-sm: 0 1px 2px rgba(18, 18, 28, .05), 0 2px 10px rgba(18, 18, 28, .04);
    --shadow-md: 0 10px 28px rgba(18, 18, 28, .08);
    --shadow-lg: 0 22px 50px rgba(18, 18, 28, .16);
    --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --heading: var(--sans);
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --base-size: 16px;
    --max: 1120px;
}

[data-theme="dark"] {
    --bg: #0f0f14;
    --bg-soft: #14141b;
    --surface: #181820;
    --surface-2: #1e1e28;
    --surface-3: #232330;
    --text: #ededf4;
    --text-2: #b0b0c0;
    --muted: #8a8a9c;
    --border: #2a2a36;
    --border-strong: #3a3a49;
    --accent: #a58bff;
    --accent-ink: #c3b1ff;
    --accent-soft: #241d3d;
    --accent-soft-2: #322855;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 10px 28px rgba(0, 0, 0, .45);
    --shadow-lg: 0 22px 50px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: var(--base-size, 16px);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    transition: background-color .2s ease, color .2s ease;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.015em; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3 { font-family: var(--heading, var(--sans)); }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }
::selection { background: var(--accent-soft-2); color: var(--text); }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.stack > * + * { margin-top: 18px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* --------------------------------------------------------------- header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(140%) blur(14px);
    border-bottom: 1px solid var(--border);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 28px;
    min-height: 68px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; flex: 0 0 auto; }
.brand:hover { text-decoration: none; }
.brand__logo { width: 190px; height: auto; }
.brand__fallback { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -.02em; color: var(--accent); }
.brand__fallback span { color: var(--text); }

.site-nav { display: flex; align-items: center; gap: 4px; margin-right: auto; }
.site-nav__link {
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--text-2);
    font-size: 14.5px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color .15s, color .15s;
}
.site-nav__link:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.site-nav__link.is-active { background: var(--accent-soft); color: var(--accent-ink); }

.site-header__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
    transition: color .15s, border-color .15s, background-color .15s;
}
.icon-btn:hover { color: var(--accent-ink); border-color: var(--accent-soft-2); }

[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }

.nav-toggle { display: none; }

.user-menu { position: relative; }
.user-menu__button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
}
.user-menu__name { font-weight: 500; }
.user-menu__panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 190px;
    padding: 6px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    display: none;
    z-index: 70;
}
.user-menu.is-open .user-menu__panel { display: block; }
.user-menu__panel a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--text-2); font-size: 14px; text-decoration: none; }
.user-menu__panel a:hover { background: var(--surface-3); color: var(--text); }
.user-menu__panel a.is-danger { color: var(--danger); }

.impersonation-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 9px 16px;
    background: var(--accent);
    color: #fff;
    font-size: 13.5px;
}
.impersonation-bar__link { color: #fff; font-weight: 600; text-decoration: underline; }

/* ---------------------------------------------------------------- buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 11px;
    border: 1px solid transparent;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: transform .12s ease, background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 32%, transparent); }
.btn--primary:hover { background: var(--accent-ink); color: #fff; }
[data-theme="dark"] .btn--primary { color: #14101f; }
[data-theme="dark"] .btn--primary:hover { color: #14101f; }
.btn--ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn--soft { background: var(--accent-soft); color: var(--accent-ink); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--sm { padding: 8px 14px; font-size: 13.5px; border-radius: 9px; }
.btn--lg { padding: 14px 28px; font-size: 15.5px; border-radius: 12px; }
.btn--block { width: 100%; }

/* ------------------------------------------------------------------ hero */

.hero { padding: 76px 0 64px; text-align: center; }
.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-transform: uppercase;
    letter-spacing: .18em;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 26px;
}
.hero__eyebrow::before, .hero__eyebrow::after { content: ""; width: 34px; height: 1px; background: var(--border-strong); }
.display { font-size: clamp(34px, 5.6vw, 58px); font-weight: 800; letter-spacing: -.035em; margin: 0; }
.accent-line { display: block; font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); letter-spacing: -.01em; }
.hero__lede { max-width: 560px; margin: 22px auto 0; color: var(--text-2); font-size: 16.5px; }
.hero__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.hero__art { margin: 34px auto 0; max-width: 320px; opacity: .95; }

/* --------------------------------------------------------------- sections */

.section { padding: 56px 0; }
.section + .section { border-top: 1px solid var(--border); }
.section__head { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.section__title { font-size: clamp(22px, 2.6vw, 30px); font-weight: 750; letter-spacing: -.025em; margin: 0 0 8px; }
.section__sub { color: var(--text-2); margin: 0; font-size: 15px; }

.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card--pad { padding: 24px; }

/* how it works */
.how-step { position: relative; padding: 30px 24px 26px; text-align: center; }
.how-step__num {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
[data-theme="dark"] .how-step__num { color: #14101f; }
.how-step__icon {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent-ink);
    margin-bottom: 14px;
    font-size: 20px;
}
.how-step h3 { font-size: 16px; margin-bottom: 6px; }
.how-step p { color: var(--text-2); font-size: 14px; margin: 0; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
}
.chip:hover { border-color: var(--accent-soft-2); color: var(--accent-ink); text-decoration: none; }

/* cta */
.cta { text-align: center; padding: 64px 24px; }
.cta h2 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -.03em; }
.cta p { max-width: 540px; margin: 0 auto 24px; color: var(--text-2); }
.cta__art { margin: 0 auto 26px; max-width: 300px; opacity: .9; }

/* ----------------------------------------------------------- member cards */

.member-card { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.member-card__head { display: flex; align-items: center; gap: 14px; }
.member-card__name { font-size: 16.5px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.member-card__name a { color: inherit; }
.member-card__bio { font-size: 13.5px; color: var(--text-2); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.member-card__group + .member-card__group { border-top: 1px solid var(--border); padding-top: 14px; }
.member-card__label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .1em;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 10px;
}
.member-card__label svg { color: var(--accent); }

.avatar { border-radius: 50%; background: var(--surface-3); object-fit: cover; flex: 0 0 auto; }
.avatar--xs { width: 26px; height: 26px; }
.avatar--sm { width: 36px; height: 36px; }
.avatar--md { width: 52px; height: 52px; }
.avatar--lg { width: 84px; height: 84px; }

/* skill tags + hover cards */
.skills-wrap { position: relative; }
.skills-row { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.skill-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
    white-space: nowrap;
}
.skill-tag:hover { text-decoration: none; background: var(--accent-soft-2); }
.skill-tag--learn { background: var(--surface-3); color: var(--text-2); }
.skill-tag__x { font-weight: 700; opacity: .55; }
.skill-tag__x:hover { opacity: 1; }

.skills-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px dashed var(--border-strong);
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}
.skills-more:hover, .skills-more:focus-visible { border-color: var(--accent); color: var(--accent-ink); }

.skills-popover {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    z-index: 40;
    width: min(300px, 78vw);
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.skills-wrap:hover .skills-popover,
.skills-wrap:focus-within .skills-popover,
.skills-wrap.is-open .skills-popover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.skills-popover__title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 8px;
}
.skills-popover .skills-row { gap: 6px; }
.skills-popover .skill-tag { font-size: 12px; }

/* ------------------------------------------------------------- blog cards */

.blog-card { overflow: hidden; display: flex; flex-direction: column; }
.blog-card__cover { aspect-ratio: 16 / 9; background: var(--accent-soft); object-fit: cover; width: 100%; }
.blog-card__cover--empty { display: grid; place-items: center; color: var(--accent); font-size: 26px; }
.blog-card__body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.blog-card__meta { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.blog-card__title { font-size: 18px; letter-spacing: -.02em; margin: 0; }
.blog-card__title a { color: var(--text); }
.blog-card__excerpt { font-size: 14px; color: var(--text-2); margin: 0; }
.blog-card__link { margin-top: auto; padding-top: 8px; font-size: 13.5px; font-weight: 600; }

/* ------------------------------------------------------------------ prose */

.prose { color: var(--text-2); font-size: 16px; line-height: 1.75; }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: 24px; color: var(--text); margin-top: 1.6em; }
.prose h3 { font-size: 19px; color: var(--text); margin-top: 1.4em; }
.prose a { color: var(--accent-ink); text-decoration: underline; }
.prose img { border-radius: var(--radius); }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); color: var(--text); font-family: var(--serif); font-size: 18px; }
.prose code { background: var(--surface-3); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.prose pre { background: var(--surface-3); padding: 16px; border-radius: var(--radius-sm); overflow: auto; }
.prose ul, .prose ol { padding-left: 22px; }

/* ------------------------------------------------------------------ forms */

.field { margin-bottom: 18px; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.input, .textarea, .select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.textarea { resize: vertical; min-height: 110px; }
.input--sm { padding: 8px 11px; font-size: 14px; }
.help { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; color: var(--text-2); margin-bottom: 10px; }
.check input { margin-top: 4px; accent-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }

.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form .input { flex: 1; }

/* ------------------------------------------------------------------ alerts */

.alert {
    margin: 18px 0;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 14.5px;
    color: var(--text);
}
.alert--success { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.alert--error { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
.alert--info { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); background: var(--accent-soft); color: var(--accent-ink); }
.alert--warning { border-color: color-mix(in srgb, var(--warn) 40%, var(--border)); background: color-mix(in srgb, var(--warn) 12%, var(--surface)); }

/* ------------------------------------------------------------ auth screens */

.auth { padding: 64px 0 90px; }
.auth__card { max-width: 460px; margin: 0 auto; padding: 34px; }
.auth__title { font-size: 26px; letter-spacing: -.025em; margin: 0 0 6px; }
.auth__sub { color: var(--text-2); font-size: 14.5px; margin: 0 0 26px; }
.auth__footer { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }

/* ------------------------------------------------------------------ pages */

.page-head { padding: 44px 0 26px; }
.page-head__title { display: flex; align-items: center; gap: 14px; font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -.03em; margin: 0 0 8px; }
.page-head__icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--accent-soft); color: var(--accent-ink); }
.page-head__sub { color: var(--text-2); margin: 0; }

.page-body { padding-bottom: 70px; }
.page-cover { border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 30px; }
.page-cover img { width: 100%; max-height: 420px; object-fit: cover; }

/* --------------------------------------------------------------- profile */

.profile-card { padding: 26px; }
.profile-head { display: flex; align-items: flex-start; gap: 18px; }
.profile-head__name { font-size: 22px; letter-spacing: -.025em; margin: 0 0 4px; }
.profile-head__meta { font-size: 13px; color: var(--muted); }
.profile-head__bio { color: var(--text-2); font-size: 14.5px; margin: 12px 0 0; }
.profile-block + .profile-block { border-top: 1px solid var(--border); margin-top: 22px; padding-top: 22px; }
.profile-block__title { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 700; margin: 0 0 12px; }
.profile-block__title svg { color: var(--accent); }
.profile-actions { margin-left: auto; display: flex; gap: 8px; }

.avatar-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 10px; }
.avatar-option { position: relative; cursor: pointer; border-radius: 50%; padding: 3px; border: 2px solid transparent; transition: border-color .15s, transform .15s; }
.avatar-option input { position: absolute; opacity: 0; pointer-events: none; }
.avatar-option img { width: 100%; aspect-ratio: 1; border-radius: 50%; background: var(--surface-3); }
.avatar-option:hover { transform: translateY(-2px); }

/* ------------------------------------------------------ public profile */

.profile-public { max-width: 900px; margin: 44px auto 70px; padding: 28px 32px 32px; }
.profile-public__top { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.profile-public__avatar { width: 56px; height: 56px; }
.profile-public__identity { min-width: 0; }
.profile-public__name { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin: 0; line-height: 1.4; }
.profile-public__bio { color: var(--text-2); font-size: 14.5px; margin: 6px 0 0; max-width: 540px; }
.profile-public__actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.profile-skills { margin-top: 26px; }
.profile-skills__title { display: flex; align-items: center; gap: 9px; font-size: 18.5px; font-weight: 750; letter-spacing: -.02em; margin: 0 0 14px; }
.profile-skills__title svg { color: var(--accent); flex: 0 0 auto; }
.profile-skills__empty { font-size: 14px; margin: 0; }
.profile-divider { border: 0; border-top: 1px solid var(--border); margin: 26px 0; }

/* -------------------------------------------------------------- messages */

.header-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 12px;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
}
.header-pill:hover { border-color: var(--accent-soft-2); color: var(--accent-ink); text-decoration: none; }
.header-pill__badge {
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: grid;
    place-items: center;
}
[data-theme="dark"] .header-pill__badge { color: #14101f; }

.conversation-list { overflow: hidden; }
.conversation { display: flex; align-items: center; gap: 14px; padding: 15px 20px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.conversation:last-child { border-bottom: 0; }
.conversation:hover { background: var(--surface-2); text-decoration: none; }
.conversation__body { flex: 1; min-width: 0; }
.conversation__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.conversation__name { font-size: 15px; font-weight: 600; }
.conversation.is-unread .conversation__name { font-weight: 750; }
.conversation__time { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.conversation__snippet { margin: 2px 0 0; font-size: 13.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation__badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; flex: 0 0 auto; }
[data-theme="dark"] .conversation__badge { color: #14101f; }

.thread-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 30px 0 18px; }
.thread-head__user { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 16px; color: var(--text); }
.thread-head__user:hover { text-decoration: none; color: var(--accent-ink); }
.thread { display: flex; flex-direction: column; gap: 10px; padding: 22px 22px 8px; }
.msg { max-width: 76%; padding: 10px 14px; border-radius: 15px; font-size: 14.5px; line-height: 1.55; }
.msg--theirs { background: var(--surface-3); border-bottom-left-radius: 5px; align-self: flex-start; }
.msg--mine { background: var(--accent); color: #fff; border-bottom-right-radius: 5px; align-self: flex-end; }
[data-theme="dark"] .msg--mine { color: #14101f; }
.msg__meta { font-size: 10.5px; opacity: .65; margin-top: 5px; }
.thread-reply { border-top: 1px solid var(--border); padding: 18px 22px 22px; margin-top: 14px; }

/* ------------------------------------------------------------ empty state */

.empty { text-align: center; padding: 54px 24px; }
.empty__icon { display: grid; place-items: center; width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 18px; background: var(--accent-soft); color: var(--accent-ink); }
.empty h3 { font-size: 17px; margin-bottom: 6px; }
.empty p { color: var(--text-2); font-size: 14px; margin: 0; }

/* ------------------------------------------------------------- pagination */

.pager { display: flex; gap: 6px; justify-content: center; margin: 34px 0 0; flex-wrap: wrap; }
.pager__item {
    min-width: 38px;
    padding: 8px 12px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    font-size: 13.5px;
    text-align: center;
    text-decoration: none;
}
.pager__item:hover { border-color: var(--accent); color: var(--accent-ink); text-decoration: none; }
.pager__item.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: var(--surface-3); color: var(--text-2); }
.badge--accent { background: var(--accent-soft); color: var(--accent-ink); }

/* --------------------------------------------------------------- footer */

.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); padding: 40px 0 28px; margin-top: 40px; }
.site-footer__inner { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.site-footer__name { font-weight: 700; font-size: 17px; }
.site-footer__logo { margin: 0 auto; }
.site-footer__text { font-size: 13.5px; color: var(--muted); margin: 10px 0 0; }
.site-footer__nav { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.site-footer__nav a { color: var(--text-2); font-size: 13.5px; }
.site-footer__copy { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
    .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .site-header__inner { min-height: 60px; gap: 12px; flex-wrap: wrap; }
    .site-nav {
        order: 3;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 0 0 14px;
        display: none;
    }
    .site-nav.is-open { display: flex; }
    .site-nav__link { padding: 11px 12px; border-radius: 10px; }
    .nav-toggle { display: inline-flex; }
    .hero { padding: 52px 0 40px; }
    .section { padding: 40px 0; }
    .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
    .form-grid, .form-grid--3 { grid-template-columns: minmax(0, 1fr); }
    .profile-head { flex-wrap: wrap; }
    .profile-actions { margin-left: 0; width: 100%; }
    .user-menu__name { display: none; }
    .brand__logo { width: 150px !important; }
    .skills-popover { left: 0; right: auto; }
}

/* ------------------------------------------------------- editor (shared) */

.rte { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.rte__toolbar { display: flex; flex-wrap: wrap; gap: 3px; padding: 7px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.rte-btn {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: 7px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-2);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.rte-btn:hover { background: var(--surface); border-color: var(--border); color: var(--text); }
.rte-btn.is-active { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-soft-2); }
.rte-btn--bold { font-weight: 800; }
.rte-btn--italic { font-style: italic; }
.rte-btn--underline { text-decoration: underline; }
.rte-btn--strike { text-decoration: line-through; }
.rte-btn--source { margin-left: auto; color: var(--accent-ink); }
.rte__sep { width: 1px; height: 18px; background: var(--border); margin: 6px 4px; }
.rte__surface { min-height: 320px; padding: 16px 18px; outline: none; color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.7; }
.rte__surface h2, .rte__surface h3 { font-family: var(--heading, var(--sans)); }
.rte-select { height: 30px; max-width: 150px; padding: 0 6px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text-2); font-family: inherit; font-size: 12.5px; cursor: pointer; }
.rte__surface:empty::before { content: attr(data-placeholder); color: var(--muted); }
.rte__surface h2 { font-size: 22px; }
.rte__surface h3 { font-size: 18px; }
.rte__surface blockquote { border-left: 3px solid var(--accent); margin: 1em 0; padding-left: 14px; color: var(--text-2); }
.rte__surface img { max-width: 100%; border-radius: 8px; }
.rte__input { width: 100%; min-height: 320px; border: 0; padding: 16px 18px; font-family: var(--mono); font-size: 13px; line-height: 1.6; background: var(--surface); color: var(--text); resize: vertical; }
.rte__hint { padding: 8px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); background: var(--surface-2); }
.rte.is-source .rte__surface { display: none; }
.rte.is-source .rte__hint { display: none; }

.media-field { margin-bottom: 18px; }
.media-field__label { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.media-field__row { display: flex; gap: 14px; align-items: center; }
.media-field__preview { width: 96px; height: 72px; border-radius: 10px; border: 1px dashed var(--border-strong); background: var(--surface-2); overflow: hidden; display: grid; place-items: center; font-size: 11px; color: var(--muted); flex: 0 0 auto; }
.media-field__preview img { width: 100%; height: 100%; object-fit: cover; }
.media-field__body { font-size: 13.5px; color: var(--text-2); }
.media-field__remove { display: inline-flex; gap: 6px; align-items: center; margin-top: 6px; font-size: 12.5px; color: var(--danger); }

/* ---------------------------------------------- support form honeypot */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ------------------------------------------------- bottom-right notices */
.toast-stack {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(330px, calc(100vw - 32px));
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    border-left: 3px solid var(--accent);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    line-height: 1.45;
    box-shadow: 0 12px 30px -14px rgba(0, 0, 0, .45);
    pointer-events: auto;
    animation: toast-in .18s ease-out;
    transition: opacity .25s ease, transform .25s ease;
}
.toast__text { flex: 1; min-width: 0; }
.toast__close {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 16px;
    line-height: 1;
    padding: 0 1px;
    cursor: pointer;
}
.toast__close:hover { color: var(--text); }
.toast--success { border-left-color: var(--ok); }
.toast--error { border-left-color: var(--danger); }
.toast--warning { border-left-color: var(--warn); }
.toast--info { border-left-color: var(--accent); }
.toast.is-out { opacity: 0; transform: translateY(6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 520px) {
    .toast-stack { right: 16px; left: 16px; bottom: 16px; width: auto; }
}

/* ------------------------------------------------------- swaps & reviews */
.profile-head__rating,
.profile-public__rating { margin: 8px 0 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.profile-public__rating { margin-top: 16px; font-size: 14px; }
.member-card__rating { margin: 6px 0 0; }

.rating { display: inline-flex; align-items: center; gap: 1px; }
.rating__star { color: color-mix(in srgb, var(--muted) 40%, transparent); font-size: 13px; line-height: 1; }
.rating__star.is-on { color: #f5b544; }
.rating__count { margin-left: 6px; font-size: 12.5px; color: var(--muted); }

.status-pill {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600; white-space: nowrap;
    background: var(--surface-3); color: var(--text-2);
}
.status-pill.is-pending { background: color-mix(in srgb, var(--warn) 15%, var(--surface)); color: color-mix(in srgb, var(--warn) 75%, var(--text)); }
.status-pill.is-accepted { background: var(--accent-soft); color: var(--accent-ink); }
.status-pill.is-completed { background: color-mix(in srgb, var(--ok) 15%, var(--surface)); color: color-mix(in srgb, var(--ok) 75%, var(--text)); }
.status-pill.is-declined,
.status-pill.is-cancelled { background: color-mix(in srgb, var(--danger) 13%, var(--surface)); color: color-mix(in srgb, var(--danger) 70%, var(--text)); }

.swap-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 4px 0 18px; }
.swap-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.swap-stat__value { display: block; font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.swap-stat__label { font-size: 12.5px; color: var(--muted); }

.swap-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.swap-tab { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); font-size: 13.5px; text-decoration: none; color: var(--text-2); background: var(--surface); }
.swap-tab.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

.swap-list { display: grid; gap: 12px; }
.swap-card { display: flex; gap: 14px; padding: 16px; text-decoration: none; color: inherit; align-items: flex-start; }
.swap-card:hover { border-color: var(--accent); }
.swap-card__body { flex: 1; min-width: 0; }
.swap-card__top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.swap-card__name { font-weight: 700; font-size: 15px; }
.swap-card__skills { display: flex; gap: 8px; align-items: center; margin: 8px 0 4px; flex-wrap: wrap; font-size: 13.5px; color: var(--text-2); }
.swap-card__tag strong { color: var(--text-2); }
.swap-card__arrow { color: var(--accent); }
.swap-card__meta { margin: 0; font-size: 12.5px; color: var(--muted); }

.swap-head { display: flex; gap: 14px; align-items: center; }
.swap-exchange { display: flex; align-items: center; gap: 16px; margin: 22px 0; padding: 16px; border: 1px dashed var(--border); border-radius: 14px; background: var(--surface-2); }
.swap-exchange__side { flex: 1; min-width: 0; }
.swap-exchange__label { display: block; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.swap-exchange__skill { font-weight: 600; font-size: 15.5px; }
.swap-exchange__arrow { color: var(--accent); font-size: 18px; }
.swap-message { border-left: 3px solid var(--accent); padding: 4px 0 4px 14px; margin: 0 0 18px; }
.swap-message__label { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.swap-message p { margin: 0; font-size: 14.5px; color: var(--text-2); }
.swap-partner-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13.5px; margin: 0 0 18px; }
.swap-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.review { padding: 16px 0; border-bottom: 1px solid var(--border); }
.review:last-child { border-bottom: 0; padding-bottom: 0; }
.review__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.review__author { font-weight: 600; font-size: 14px; }
.review__date { font-size: 12.5px; margin-left: auto; }
.review__body { margin: 0; font-size: 14.5px; color: var(--text-2); }

.star-picker { display: flex; gap: 4px; }
.star-picker__star { background: none; border: 0; cursor: pointer; font-size: 26px; line-height: 1; padding: 0 2px; color: color-mix(in srgb, var(--muted) 40%, transparent); transition: color .12s, transform .12s; }
.star-picker__star:hover { transform: translateY(-1px); }
.star-picker__star.is-on { color: #f5b544; }

.back-link { display: inline-block; font-size: 13.5px; color: var(--text-2); text-decoration: none; }
.back-link:hover { color: var(--accent); }
.auth__aside { margin: 12px 0 0; text-align: center; font-size: 13.5px; }

/* ------------------------------------------------- dashboard & availability */
.open-badge { display: inline-block; margin-left: 8px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .01em; background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: color-mix(in srgb, var(--ok) 80%, var(--text)); vertical-align: middle; }
.open-dot { display: inline-block; width: 8px; height: 8px; margin-left: 7px; border-radius: 50%; background: var(--ok); vertical-align: middle; }

.swap-stat--link { text-decoration: none; color: inherit; display: block; transition: border-color .15s, transform .15s; }
.swap-stat--link:hover { border-color: var(--accent); transform: translateY(-1px); }

.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dash-head a { font-size: 13.5px; }
.dash-availability { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dash-availability__title { font-size: 16px; margin: 0; letter-spacing: -.01em; }

.swap-card--flat { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.swap-card--flat:hover { border-color: var(--accent); }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist__item { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--text-2); }
.checklist__item.is-done { color: var(--text-2); }
.checklist__mark { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; background: var(--surface-3); color: var(--muted); flex: 0 0 auto; margin-top: 1px; }
.checklist__item.is-done .checklist__mark { background: color-mix(in srgb, var(--ok) 18%, var(--surface)); color: var(--ok); }

.profile-safety { max-width: 900px; margin: 18px auto 0; padding: 0 4px; }
.profile-safety summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.profile-safety summary:hover { color: var(--text-2); }
.profile-safety__body { margin-top: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }

.blocked-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.blocked-row:first-of-type { border-top: 0; }
.blocked-row__name { flex: 1; font-size: 14px; }
