/* ==========================================================
   GrowUp design system (dashboard, auth and shared components)
   Light, clean and professional: white / soft grey surfaces,
   teal-green primary, gold call-to-action accents, dark text.
   No inline styles anywhere (strict CSP friendly).
   ========================================================== */
:root {
    --ink: #0F1D2E;
    --ink-soft: #334155;
    --canvas: #F4F7F9;
    --surface: #FFFFFF;
    --line: #E2E8EE;
    --line-strong: #CBD5E1;
    --muted: #5B6778;
    --ledger: #0B8A6A;        /* primary: teal-green */
    --ledger-deep: #076650;
    --ledger-tint: #E5F5EF;
    --brand-blue: #1463C9;    /* from the GrowUp logo */
    --brand-navy: #0D2B5E;
    --brand-green: #3BAA35;
    --saffron: #F5B31B;       /* gold call-to-action */
    --saffron-deep: #D99A08;
    --saffron-tint: #FFF6DE;
    --danger: #C0352B;
    --danger-tint: #FDECEA;

    --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 20px;
    --shadow-xs: 0 1px 2px rgba(15, 29, 46, .06);
    --shadow-sm: 0 1px 3px rgba(15, 29, 46, .06), 0 4px 12px -6px rgba(15, 29, 46, .08);
    --shadow-md: 0 12px 30px -14px rgba(15, 29, 46, .22), 0 4px 10px -6px rgba(15, 29, 46, .08);
    --focus: 0 0 0 3px rgba(11, 138, 106, .28);
    --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--canvas);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--ledger); font-weight: 600; text-underline-offset: 3px; }
a:hover { color: var(--ledger-deep); }
h1, h2 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.015em; }
h1 { font-size: 1.75rem; font-weight: 800; }
h2 { font-size: 1.08rem; font-weight: 700; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.strong { font-weight: 700; }
.skip-link { position: absolute; left: 1rem; top: -3rem; z-index: 200; background: var(--saffron); color: var(--ink); padding: .5rem .9rem; border-radius: 8px; }
.skip-link:focus { top: 1rem; }

/* Brand logo (exact uploaded GrowUp artwork; sizes keep its 3:1 ratio) */
.logo { display: inline-flex; align-items: center; line-height: 0; flex: none; }
.logo img { display: block; width: auto; object-fit: contain; mix-blend-mode: multiply; }
.logo--xs img { height: 28px; }
.logo--sm img { height: 34px; }
.logo--md img { height: 44px; }
.logo--lg img { height: 56px; }
.logo--footer img { height: 40px; }
.logo--plate { background: #fff; padding: .55rem .8rem; border-radius: 12px; }
@media (max-width: 640px) {
    .logo--md img { height: 34px; }
    .logo--lg img { height: 46px; }
}

/* ==========================================================
   Buttons
   ========================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: .5rem;
    padding: .72rem 1.25rem;
    font: inherit; font-weight: 700; font-size: .95rem; line-height: 1.2;
    border: 1.5px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .18s, border-color .18s, color .18s, transform .18s var(--ease), box-shadow .18s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn .icon { width: 1.1em; height: 1.1em; }
.btn--primary { background: var(--ledger); color: #fff; box-shadow: 0 6px 16px -8px rgba(11, 138, 106, .6); }
.btn--primary:hover { background: var(--ledger-deep); color: #fff; box-shadow: 0 10px 20px -10px rgba(11, 138, 106, .7); }
.btn--accent { background: var(--saffron); color: #1B1405; box-shadow: 0 6px 16px -8px rgba(217, 154, 8, .7); }
.btn--accent:hover { background: #FFC23A; color: #1B1405; box-shadow: 0 10px 22px -10px rgba(217, 154, 8, .8); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #1C2F47; color: #fff; }
.btn--ghost, .btn--outline { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover, .btn--outline:hover { border-color: var(--ledger); color: var(--ledger-deep); background: var(--ledger-tint); }
.btn--light { background: #fff; color: var(--ink); }
.btn--light:hover { background: var(--ledger-tint); color: var(--ledger-deep); }
.btn--outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .6); }
.btn--outline-light:hover { background: rgba(255, 255, 255, .12); color: #fff; border-color: #fff; }
.btn--link { background: none; color: var(--muted); border: 0; font-weight: 600; text-decoration: underline; }
.btn--link:hover { color: var(--ink); transform: none; }
.btn--sm { padding: .5rem .85rem; font-size: .86rem; border-radius: 9px; }
.btn--lg { padding: .95rem 1.6rem; font-size: 1.02rem; border-radius: 12px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: var(--ink); }

/* ==========================================================
   Auth layout (login, register, forgot/reset password)
   ========================================================== */
.auth { display: grid; grid-template-columns: minmax(0, 7fr) minmax(300px, 5fr); min-height: 100vh; background: var(--surface); }
.auth__main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2.5rem 1.25rem; gap: 1.5rem; }
.auth__card { width: 100%; max-width: 28rem; background: var(--surface); }
.auth__logo { margin-bottom: 1.75rem; }
.auth__foot { font-size: .8rem; color: var(--muted); margin: 0; }
.auth__foot a { color: var(--muted); font-weight: 500; }
.auth__side {
    background: linear-gradient(160deg, #0B8A6A 0%, #0A6E8A 55%, #0D2B5E 100%);
    color: #E6F2EF;
    padding: 3rem;
    display: flex; flex-direction: column; justify-content: center;
    position: relative; overflow: hidden;
}
.auth__side::before, .auth__side::after {
    content: ""; position: absolute; border-radius: 50%; pointer-events: none;
    background: radial-gradient(circle, rgba(245, 179, 27, .35), transparent 65%);
}
.auth__side::before { width: 420px; height: 420px; right: -140px; top: -120px; }
.auth__side::after { width: 360px; height: 360px; left: -140px; bottom: -140px; background: radial-gradient(circle, rgba(59, 170, 53, .35), transparent 65%); }
.auth__pitch { position: relative; z-index: 1; max-width: 24rem; }
.auth__statement { font-size: 2.1rem; line-height: 1.15; font-weight: 800; color: #fff; margin: 0 0 1rem; letter-spacing: -.02em; }
.auth__sub { margin: 0 0 1.5rem; }
.auth__points { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; font-weight: 600; }
.auth__points .icon { color: var(--saffron); margin-right: .4rem; }
.auth__title { margin-bottom: .35rem; font-size: 1.65rem; }
.auth__lead { color: var(--muted); margin: 0 0 1.75rem; }
.auth__back { margin: 0 0 1rem; font-size: .9rem; }
.auth__split-actions { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: 1.25rem; font-size: .9rem; }

/* ==========================================================
   Forms
   ========================================================== */
.form { display: grid; gap: 1.1rem; }
.form__row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: .9rem; flex-wrap: wrap; }
.field { min-width: 0; }
.field label { display: block; font-weight: 700; font-size: .875rem; margin-bottom: .35rem; color: var(--ink); }
.field input, .field select {
    width: 100%;
    font: inherit; font-size: .95rem;
    padding: .7rem .85rem;
    border: 1.5px solid var(--line-strong);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
.field input:hover, .field select:hover { border-color: #9FB0C3; }
.field input:focus, .field select:focus { border-color: var(--ledger); box-shadow: var(--focus); outline: none; }
.field input[readonly], .field input[disabled] { background: var(--canvas); color: var(--muted); }
.field__control { position: relative; }
.field__control input[type="password"], .field__control input[data-revealed] { padding-right: 4.2rem; }
.field__reveal {
    position: absolute; right: .4rem; top: 50%; transform: translateY(-50%);
    background: none; border: 0; font: inherit; font-size: .8rem; font-weight: 700;
    color: var(--muted); cursor: pointer; padding: .35rem .5rem;
}
.field__hint { margin: .35rem 0 0; font-size: .8rem; color: var(--muted); }
.field__error { margin: .35rem 0 0; font-size: .82rem; color: var(--danger); font-weight: 600; }
.field--invalid input, .field--invalid select, .field--invalid textarea { border-color: var(--danger); }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500 !important; font-size: .9rem; cursor: pointer; }
.check input { width: 1.05rem; height: 1.05rem; margin-top: .2rem; accent-color: var(--ledger); flex: none; }

.alert { padding: .85rem 1rem; border-radius: 12px; margin-bottom: 1.25rem; font-size: .92rem; font-weight: 600; border: 1px solid; }
.alert ul { margin: .4rem 0 0; padding-left: 1.1rem; font-weight: 500; }
.alert--success { background: var(--ledger-tint); border-color: #A7DCCB; color: var(--ledger-deep); }
.alert--error { background: var(--danger-tint); border-color: #F3B8B2; color: var(--danger); }

/* Account-type chooser */
.choice { display: grid; gap: .85rem; }
.choice__option {
    display: block;
    padding: 1.25rem 1.35rem;
    border: 1.5px solid var(--line);
    border-radius: var(--r-md);
    color: var(--ink);
    text-decoration: none;
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    transition: border-color .15s, background-color .15s, transform .18s var(--ease), box-shadow .18s;
}
.choice__option:hover { border-color: var(--ledger); background: var(--ledger-tint); color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.choice__title { display: block; font-size: 1.1rem; font-weight: 800; margin-bottom: .2rem; }
.choice__text { display: block; font-weight: 500; color: var(--muted); font-size: .92rem; }

/* ==========================================================
   Dashboard shell: sidebar + app bar
   ========================================================== */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    background: var(--surface); border-right: 1px solid var(--line);
    display: flex; flex-direction: column; padding: 1rem .85rem;
}
.sidebar__brand { display: flex; align-items: center; justify-content: space-between; padding: .25rem .5rem 1.1rem; border-bottom: 1px solid var(--line); margin-bottom: .75rem; }
.sidebar__close { display: none; color: var(--muted); padding: .35rem; border-radius: 8px; }
.sidebar__foot { margin-top: auto; padding-top: .75rem; border-top: 1px solid var(--line); }
.sidebar__logout { display: flex; align-items: center; gap: .65rem; width: 100%; background: none; border: 0; font: inherit; font-weight: 600; font-size: .92rem; color: var(--muted); padding: .6rem .75rem; border-radius: 10px; cursor: pointer; }
.sidebar__logout:hover { background: var(--danger-tint); color: var(--danger); }
.mainnav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.mainnav a {
    display: flex; align-items: center; gap: .7rem;
    color: var(--ink-soft); font-size: .93rem; font-weight: 600; text-decoration: none;
    padding: .6rem .75rem; border-radius: 10px;
    transition: background-color .15s, color .15s;
}
.mainnav a .icon { color: #8A97A8; transition: color .15s; }
.mainnav a:hover .icon { color: var(--ledger); }
.mainnav a.is-active .icon { color: var(--ledger); }
.mainnav .nav-badge { margin-left: auto; }
.sidebar-scrim { display: none; }

.shell__main { min-width: 0; display: flex; flex-direction: column; }
.appbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: .75rem;
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    padding: .65rem 1.5rem; min-height: 64px;
}
.appbar__menu { display: none; color: var(--ink); padding: .45rem; border-radius: 10px; border: 1.5px solid var(--line); line-height: 0; }
.appbar__logo { display: none; }
.appbar__spacer { flex: 1; }
.appbar__user { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); padding: .25rem .5rem .25rem .25rem; border-radius: 999px; }
.appbar__user:hover { background: var(--canvas); color: var(--ink); }
.appbar__who { display: grid; line-height: 1.2; }
.appbar__who strong { font-size: .88rem; }
.appbar__who small { font-size: .74rem; color: var(--muted); font-weight: 600; }
.page { width: 100%; max-width: 76rem; margin: 0 auto; padding: 2rem 1.5rem 4rem; flex: 1; }
.page:focus { outline: none; box-shadow: none; }
.page__head { margin-bottom: 1.5rem; }
.page__head p { margin: 0; }
.page__head--split { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.page__actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.appfoot { display: flex; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.5rem; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.appfoot a { color: var(--muted); font-weight: 500; }

.role-tag { font-size: .75rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; white-space: nowrap; }
.role-tag--client { background: var(--ledger-tint); color: var(--ledger-deep); }
.role-tag--freelancer { background: var(--saffron-tint); color: #7A5200; }
.role-tag--admin { background: var(--ink); color: #fff; }

.banner {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
    background: var(--saffron-tint);
    border: 1px solid #F4D98F;
    padding: .8rem 1rem;
    border-radius: var(--r-md);
    margin-bottom: 1.25rem;
}
.banner p { margin: 0; font-size: .92rem; }

.grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.5rem; box-shadow: var(--shadow-xs); }
.panel--actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.panel--actions p { margin: 0; }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 1rem 0; display: grid; gap: .65rem; }
.steps li { counter-increment: step; display: flex; align-items: center; gap: .75rem; font-weight: 600; }
.steps li::before {
    content: counter(step);
    width: 1.75rem; height: 1.75rem; flex: none;
    display: grid; place-items: center;
    border: 1.5px solid var(--line); border-radius: 50%;
    font-size: .8rem; color: var(--muted);
}
.steps li.is-done { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.steps li.is-done::before { content: "\2713"; background: var(--ledger); border-color: var(--ledger); color: #fff; }

.facts { margin: .75rem 0 0; display: grid; gap: .7rem; }
.facts div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed var(--line); padding-bottom: .55rem; }
.facts div:last-child { border-bottom: 0; padding-bottom: 0; }
.facts dt { color: var(--muted); font-size: .88rem; }
.facts dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }

.chips { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { font-size: .8rem; font-weight: 600; padding: .25rem .6rem; border-radius: 999px; background: var(--canvas); }
.chip--primary { background: var(--ledger); color: #fff; }
.chips a { display: inline-block; font-size: .85rem; padding: .35rem .75rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink-soft); }
.chips a:hover { border-color: var(--ledger); color: var(--ledger-deep); background: var(--ledger-tint); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .9rem; margin: 0 0 1.25rem; padding: 0; }
.stats div { background: var(--surface); padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-xs); }
.stats dt { font-size: .82rem; color: var(--muted); font-weight: 600; }
.stats dd { margin: .2rem 0 0; font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; margin-top: .75rem; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 700; padding: .55rem .75rem; border-bottom: 1.5px solid var(--line); }
.table td { padding: .7rem .75rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td.wrap { white-space: normal; }

.doc { max-width: 44rem; margin: 0 auto; padding: 3rem 1.25rem; }
.doc h1 { margin-top: 2rem; }

/* ==========================================================
   Responsive + motion
   ========================================================== */
@media (max-width: 1024px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar {
        position: fixed; inset: 0 auto 0 0; z-index: 60; width: min(290px, 86vw); height: 100%;
        transform: translateX(-105%); transition: transform .25s var(--ease); box-shadow: var(--shadow-md);
    }
    .sidebar:target, html.sidebar-open .sidebar { transform: none; }
    .sidebar__close { display: inline-flex; }
    html.sidebar-open .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(15, 29, 46, .38); }
    .appbar { padding: .6rem 1rem; }
    .appbar__menu, .appbar__logo { display: inline-flex; }
    .page { padding: 1.5rem 1rem 3rem; }
}
@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .auth__side { display: none; }
    .grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .appbar__who, .appbar__cta { display: none; }
    .panel { padding: 1.15rem; }
    h1 { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ==========================================================
   Phase 2: marketplace
   ========================================================== */
.field textarea {
    width: 100%; font: inherit; font-size: .95rem; color: var(--ink);
    padding: .7rem .8rem; border: 1.5px solid var(--line); border-radius: var(--r-sm);
    background: var(--surface); resize: vertical; min-height: 6rem;
}
.field textarea:focus { border-color: var(--ledger); box-shadow: var(--focus); outline: none; }
.field--invalid textarea { border-color: var(--danger); }
.field input[type="file"] { padding: .5rem; background: var(--canvas); }
.field input[type="search"], .toolbar input, .toolbar select {
    font: inherit; font-size: .9rem; padding: .55rem .7rem; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink);
}
fieldset.field { border: 0; padding: 0; margin: 0 0 1.1rem; min-width: 0; }
fieldset.field legend { font-weight: 700; font-size: .875rem; margin-bottom: .35rem; padding: 0; }
.optional { font-weight: 500; font-size: .78rem; color: var(--muted); margin-left: .25rem; }
.hidden { display: none !important; }
.lead { font-size: 1.05rem; font-weight: 600; margin: 0 0 1.25rem; }
.plain { white-space: pre-line; overflow-wrap: anywhere; margin-bottom: 1rem; }
.stack { display: grid; gap: 1.25rem; align-content: start; }
.crumb { margin: 0 0 .75rem; font-size: .88rem; }
.crumb a::before { content: "\2190  "; }
h3 { font-size: 1rem; margin: 0 0 .35rem; line-height: 1.3; }
.panel h2 + .lead, .panel h2 + .plain { margin-top: .25rem; }
.panel > h2:not(:first-child) { margin-top: 1.25rem; }

/* Navigation */

/* Page head with action */
.page__head--row { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.panel__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .5rem; }
.panel__head a { font-size: .88rem; }
.panel--accent { border-color: var(--saffron); box-shadow: inset 4px 0 0 var(--saffron); }

/* Tabs */
.tabs { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1.5px solid var(--line); margin-bottom: 1.25rem; }
.tabs a { white-space: nowrap; padding: .6rem .8rem; color: var(--muted); text-decoration: none; font-size: .9rem; border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; }
.tabs a span { font-size: .75rem; background: var(--canvas); border-radius: 999px; padding: .05rem .45rem; margin-left: .2rem; }
.tabs a.is-active { color: var(--ink); border-color: var(--ledger); }

/* Status badges */
.status { display: inline-block; font-size: .75rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; background: var(--canvas); color: var(--ink-soft); white-space: nowrap; }
.status--draft { background: #EEF0F3; color: var(--muted); }
.status--published { background: var(--ledger-tint); color: var(--ledger-deep); }
.status--in_review { background: #E8EEFB; color: #274690; }
.status--hiring { background: var(--saffron-tint); color: #7A5200; }
.status--in_progress { background: #E6F4FA; color: #0B5A78; }
.status--completed { background: var(--ledger); color: #fff; }
.status--cancelled { background: var(--danger-tint); color: var(--danger); }
.status--hidden { background: var(--ink); color: #fff; }

/* Rows (lists) */
.rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.rows--flat { border: 0; background: none; }
.row { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); align-items: center; }
.rows--flat .row { padding: .85rem 0; }
.row:last-child { border-bottom: 0; }
.row__main { min-width: 0; }
.row__title { font-weight: 700; color: var(--ink); text-decoration: none; }
a.row__title:hover { color: var(--ledger); }
.row__meta { display: flex; flex-wrap: wrap; gap: .35rem .9rem; align-items: center; color: var(--muted); font-size: .88rem; margin: .3rem 0 0; }
.row__side { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; font-size: .88rem; flex-shrink: 0; }
.chips--sm { margin-top: .6rem; }
.chips--sm .chip { font-size: .74rem; padding: .18rem .5rem; }
.chip--soft { background: transparent; border: 1px dashed var(--line); color: var(--muted); }

/* Empty states */
.empty { text-align: center; padding: 2.5rem 1.5rem; }
.empty p { max-width: 32rem; margin: .25rem auto 1rem; }

/* Pagination */
.pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin: 1.25rem 0 0; font-size: .9rem; }
.pager__btn { padding: .45rem .8rem; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--surface); text-decoration: none; }
.pager__btn.is-disabled { color: var(--muted); opacity: .6; }
.pager__info { color: var(--muted); }

/* Forms */
.form--wide { max-width: none; }
.formsec { padding: 0 0 1.25rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.formsec:last-of-type { border-bottom: 0; }
.formsec h2 { margin-bottom: .9rem; }
.form__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 1.25rem; }
.form__actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.form--sub { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px dashed var(--line); }
.inline-form { margin: 0 0 .5rem; }
.segmented { display: inline-flex; border: 1.5px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.segmented label { margin: 0; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: .6rem 1rem; font-size: .9rem; font-weight: 600; color: var(--muted); }
.segmented input:checked + span { background: var(--ledger); color: #fff; }
.segmented input:focus-visible + span { box-shadow: var(--focus); }
.link-btn--danger { color: var(--danger); }
.filelist { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.filelist li { display: flex; gap: .75rem; align-items: baseline; flex-wrap: wrap; overflow-wrap: anywhere; }
.photo-row { display: flex; gap: 1.25rem; align-items: flex-start; }

/* Skill picker */
.skillpicker__search { width: 100%; margin-bottom: .6rem; }
.skillpicker__list { max-height: 18rem; overflow-y: auto; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: .75rem; background: var(--surface); }
.skillpicker__group + .skillpicker__group { margin-top: .6rem; }
.skillpicker__cat { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 .35rem; }
.chipcheck { display: inline-flex; margin: 0 .3rem .35rem 0; cursor: pointer; }
.chipcheck input { position: absolute; opacity: 0; pointer-events: none; }
.chipcheck span { font-size: .82rem; font-weight: 600; padding: .3rem .7rem; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); }
.chipcheck input:checked + span { background: var(--ledger); border-color: var(--ledger); color: #fff; }
.chipcheck input:focus-visible + span { box-shadow: var(--focus); }
.field .chipcheck { font-weight: 400; }

/* Match meter */
.meter { display: inline-grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .6rem; align-items: center; min-width: 8.5rem; }
.meter__value { grid-row: span 2; font-size: 1.45rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.meter__track { height: .45rem; background: var(--canvas); border-radius: 999px; overflow: hidden; }
.meter__fill { display: block; height: 100%; background: var(--ledger); border-radius: 999px; }
.meter__label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.meter--fair .meter__fill { background: var(--saffron); }
.meter--weak .meter__fill { background: #9AA5B4; }
.meter--strong .meter__value { color: var(--ledger-deep); }

/* Factors ("why matched") */
.factors { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .7rem; }
.factor { display: grid; grid-template-columns: 9.5rem 1fr 3rem; gap: .2rem .75rem; align-items: center; font-size: .88rem; }
.factor__label { font-weight: 700; }
.factor__bar { height: .4rem; background: var(--canvas); border-radius: 999px; overflow: hidden; }
.factor__bar > span { display: block; height: 100%; background: var(--ledger); }
.factor__score { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.factor__detail { grid-column: 1 / -1; color: var(--muted); font-size: .84rem; }
.why { margin-top: .9rem; border-top: 1px dashed var(--line); padding-top: .7rem; }
.why summary { cursor: pointer; font-weight: 700; font-size: .9rem; color: var(--ledger); }
.why[open] summary { margin-bottom: .25rem; }

/* Cards */
.card-person, .card-project { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.25rem 1.4rem; }
.card-person__id { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; }
.card-person h3, .card-project h3 { margin: 0; }
.card-project__head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.card-project h3 a { color: var(--ink); text-decoration: none; }
.card-project h3 a:hover { color: var(--ledger); }
.card-project__goal { margin: .7rem 0 0; }
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--ledger-tint); flex-shrink: 0; }
.avatar--lg { width: 80px; height: 80px; }
.avatar--initials { display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: var(--ledger-deep); }
.avatar--lg.avatar--initials { font-size: 1.4rem; }

/* Analysis */
.goalcard { background: var(--ink); color: #fff; border-radius: var(--r-md); padding: 1.6rem 1.75rem; margin-bottom: 1.25rem; }
.goalcard__label { margin: 0; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--saffron); font-weight: 700; }
.goalcard__text { font-size: 1.3rem; font-weight: 800; line-height: 1.35; margin: .35rem 0 .5rem; }
.goalcard__sub { margin: 0; color: #C9D1DC; font-size: .92rem; }
.goalcard__facts { display: flex; flex-wrap: wrap; gap: .75rem 2.5rem; margin: 1.1rem 0 0; }
.goalcard__facts dt { font-size: .75rem; color: #9FB0C3; }
.goalcard__facts dd { margin: .1rem 0 0; font-weight: 700; }
.goalcard .muted { color: #9FB0C3; }
.timeline { list-style: none; counter-reset: ms; margin: .5rem 0 1rem; padding: 0; }
.timeline li { counter-increment: ms; position: relative; padding: 0 0 1.1rem 2.6rem; border-left: 2px solid var(--line); margin-left: .9rem; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: counter(ms); position: absolute; left: -0.95rem; top: -.1rem; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--ledger); color: #fff; font-weight: 800; font-size: .8rem; display: flex; align-items: center; justify-content: center; }
.timeline strong { margin-right: .5rem; }
.timeline p { margin: .2rem 0 0; }
.ticks { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .4rem; }
.ticks li { padding-left: 1.5rem; position: relative; }
.ticks li::before { content: "\2713"; position: absolute; left: 0; color: var(--ledger); font-weight: 800; }
.ticks--todo li::before { content: "\25CB"; color: var(--muted); }
.qlist { margin: .5rem 0 1rem; padding-left: 1.2rem; display: grid; gap: .55rem; }
.skilllist, .rolelist { list-style: none; padding: 0; margin: .5rem 0 1rem; display: grid; gap: .55rem; }
.skilllist li, .rolelist li { display: flex; flex-direction: column; gap: .15rem; align-items: flex-start; }

/* Filter layout */
.layout-filter { display: grid; grid-template-columns: 16rem 1fr; gap: 1.25rem; align-items: start; }
.filters { position: sticky; top: 1rem; }
.filters .field select, .filters .field input { width: 100%; }
.filters .btn + .btn { margin-top: .5rem; }
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.toolbar input[type="search"] { flex: 1; min-width: 14rem; }
.disclaimer { font-size: .82rem; color: var(--muted); margin: 1.25rem 0 0; }

@media (max-width: 860px) {
    .layout-filter { grid-template-columns: 1fr; }
    .filters { position: static; }
}
@media (max-width: 640px) {
    .row { flex-direction: column; align-items: flex-start; }
    .row__side { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
    .card-person__id { grid-template-columns: auto 1fr; }
    .card-person__id .meter { grid-column: 1 / -1; }
    .card-project__head { flex-direction: column; }
    .factor { grid-template-columns: 1fr 2.8rem; }
    .factor__bar { grid-column: 1 / -1; grid-row: 2; }
    .photo-row { flex-direction: column; }
    .goalcard__text { font-size: 1.1rem; }
}

/* Width utilities for meters (inline styles are blocked by the CSP) */
.meter__fill--0, .factor__bar .meter__fill--0 { width: 0%; }
.meter__fill--5, .factor__bar .meter__fill--5 { width: 5%; }
.meter__fill--10, .factor__bar .meter__fill--10 { width: 10%; }
.meter__fill--15, .factor__bar .meter__fill--15 { width: 15%; }
.meter__fill--20, .factor__bar .meter__fill--20 { width: 20%; }
.meter__fill--25, .factor__bar .meter__fill--25 { width: 25%; }
.meter__fill--30, .factor__bar .meter__fill--30 { width: 30%; }
.meter__fill--35, .factor__bar .meter__fill--35 { width: 35%; }
.meter__fill--40, .factor__bar .meter__fill--40 { width: 40%; }
.meter__fill--45, .factor__bar .meter__fill--45 { width: 45%; }
.meter__fill--50, .factor__bar .meter__fill--50 { width: 50%; }
.meter__fill--55, .factor__bar .meter__fill--55 { width: 55%; }
.meter__fill--60, .factor__bar .meter__fill--60 { width: 60%; }
.meter__fill--65, .factor__bar .meter__fill--65 { width: 65%; }
.meter__fill--70, .factor__bar .meter__fill--70 { width: 70%; }
.meter__fill--75, .factor__bar .meter__fill--75 { width: 75%; }
.meter__fill--80, .factor__bar .meter__fill--80 { width: 80%; }
.meter__fill--85, .factor__bar .meter__fill--85 { width: 85%; }
.meter__fill--90, .factor__bar .meter__fill--90 { width: 90%; }
.meter__fill--95, .factor__bar .meter__fill--95 { width: 95%; }
.meter__fill--100, .factor__bar .meter__fill--100 { width: 100%; }

/* ==========================================================
   Phase 3: proposals, contracts, milestones, notifications
   ========================================================== */
.eyebrow { margin: 0 0 .25rem; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ledger); }
.mt { margin-top: 1.25rem; }
.mb { margin-bottom: 1.25rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.actions--card { margin-top: .9rem; padding-top: .8rem; border-top: 1px dashed var(--line); }
.overdue { color: var(--danger); font-weight: 700; }

/* Extra status colours */
.status--submitted { background: #E8EEFB; color: #274690; }
.status--shortlisted { background: var(--saffron-tint); color: #7A5200; }
.status--rejected, .status--withdrawn { background: #EEF0F3; color: var(--muted); }
.status--accepted, .status--active, .status--approved { background: var(--ledger); color: #fff; }
.status--pending { background: #EEF0F3; color: var(--ink-soft); }
.status--paused { background: var(--saffron-tint); color: #7A5200; }
.status--disputed, .status--revision_requested { background: var(--danger-tint); color: var(--danger); }

/* Payment state */
.pay { display: inline-block; font-size: .72rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; border: 1px dashed var(--line); color: var(--muted); white-space: nowrap; }
.pay--ready_for_payment { border-color: var(--saffron); color: #7A5200; background: var(--saffron-tint); }
.pay--paid { border-style: solid; border-color: var(--ledger); color: var(--ledger-deep); }
.pay--refunded { border-color: var(--danger); color: var(--danger); }

/* Notification bell */
.bell { position: relative; display: inline-flex; align-items: center; color: var(--ink-soft); text-decoration: none; padding: .5rem; border-radius: 999px; line-height: 0; }
.bell .icon { width: 1.3rem; height: 1.3rem; }
.bell .bell__count { position: absolute; top: .05rem; right: -.2rem; margin: 0; line-height: 1.2; }
.bell:hover { background: var(--canvas); color: var(--ink); }
.bell__count { display: inline-block; min-width: 1.3rem; margin-left: .35rem; padding: .05rem .4rem; border-radius: 999px; background: var(--saffron); color: var(--ink); font-size: .72rem; font-weight: 800; text-align: center; }
.notice.is-unread { box-shadow: inset 4px 0 0 var(--saffron); background: #FFFCF4; }
.notice p { margin: .2rem 0 0; }

/* Proposal form milestone rows */
.msrows { display: grid; gap: .45rem; }
.msrows__head, .msrows__row { display: grid; grid-template-columns: 1fr 8rem 6rem; gap: .5rem; }
.msrows__head span { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.msrows input { width: 100%; font: inherit; font-size: .9rem; padding: .55rem .65rem; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); }
.msrows input:focus { border-color: var(--ledger); box-shadow: var(--focus); outline: none; }

/* Insights */
.insights__head { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.insights__head p { margin: 0; flex: 1; min-width: 10rem; }
.person-head { display: flex; gap: 1rem; align-items: center; }
.stats--inline { margin-bottom: 1rem; }
.stats dd a { color: inherit; text-decoration: none; }
.stat--alert { box-shadow: inset 0 -3px 0 var(--saffron); }

/* Milestone list */
.mslist { list-style: none; margin: .5rem 0 0; padding: 0; }
.mslist__item { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.mslist__item:last-child { border-bottom: 0; }
.mslist__main { min-width: 0; }

/* Review + history */
.review-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: .75rem; }
.history { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: 1rem; }
.history__item { border: 1px solid var(--line); border-radius: var(--r-md); padding: 1rem 1.1rem; background: var(--surface); }
.history__item + .history__item { margin-top: .6rem; }
.history__head { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; }
.history__review { margin: .6rem 0 0; padding-top: .6rem; border-top: 1px dashed var(--line); }
.activity { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .5rem; }
.activity li { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .9rem; }
.activity__action { font-weight: 600; text-transform: capitalize; }
.toolbar .check { display: inline-flex; align-items: center; gap: .35rem; font-size: .88rem; }

@media (max-width: 860px) {
    .review-actions { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .msrows__head { display: none; }
    .msrows__row { grid-template-columns: 1fr 1fr; }
    .msrows__row input:first-child { grid-column: 1 / -1; }
    .mslist__item { flex-direction: column; align-items: flex-start; }
    .person-head { align-items: flex-start; }
}

/* ==========================================================
   Phase 4: payments, payouts, receipts
   ========================================================== */
.status--processing, .status--requested, .status--refund_pending { background: #E8EEFB; color: #274690; }
.status--paid { background: var(--ledger); color: #fff; }
.status--failed { background: var(--danger-tint); color: var(--danger); }
.status--refunded, .status--partially_refunded { background: #EEF0F3; color: var(--ink-soft); }
.pay--processing { border-color: #274690; color: #274690; }
.pay--partially_refunded { border-color: var(--danger); color: var(--danger); }
.facts__total { border-bottom: 2px solid var(--ink) !important; }
.facts__total dt, .facts__total dd { font-weight: 800; color: var(--ink); font-size: 1rem; }
.code { background: var(--canvas); padding: .75rem; border-radius: var(--r-sm); overflow-x: auto; white-space: pre; }

.receipt { max-width: 44rem; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 2rem; }
.receipt__head { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 1rem; margin-bottom: 1rem; }
.receipt__brand { margin: 0; font-weight: 800; color: var(--ledger); letter-spacing: .02em; }
.receipt__meta { margin: 0; display: grid; gap: .25rem; font-size: .88rem; }
.receipt__meta div { display: flex; gap: .75rem; justify-content: space-between; }
.receipt__meta dt { color: var(--muted); }
.receipt__meta dd { margin: 0; font-weight: 700; }
.receipt__lines th { text-align: left; font-weight: 600; color: var(--ink-soft); }
.receipt__lines td { text-align: right; font-variant-numeric: tabular-nums; }
.receipt__total th, .receipt__total td { border-top: 2px solid var(--ink); font-weight: 800; }

@media print {
    .topbar, .sidebar, .appbar, .appfoot, .no-print, .banner, .alert { display: none !important; }
    .shell { display: block; }
    body { background: #fff; }
    .page { padding: 0; }
    .receipt { border: 0; padding: 0; }
}

/* ==========================================================
   Redesign release: shared components, chat, reviews
   ========================================================== */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.btn { transition: background-color .15s, border-color .15s, transform .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn .icon { width: 1.1em; height: 1.1em; }

/* Stars, pills, tags (also used on public pages) */
.stars { display: inline-flex; align-items: center; gap: .35rem; font-size: .88rem; flex-wrap: wrap; }
.stars__icons { display: inline-flex; gap: 1px; }
.star { width: 1rem; height: 1rem; stroke: none; }
.star--full { fill: #F2B233; }
.star--half { fill: url(#g-half); }
.star--empty { fill: #D5DBE2; }
.stars__count, .stars--none { color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.pill--ok { background: #E7F6EC; color: #166534; }
.pill--info { background: #E6F0FF; color: #1D4ED8; }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; margin: .1rem 0 0; padding: 0; }
.tags li { padding: .2rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #EEF3F4; color: var(--ink-soft); }
.nav-badge { display: inline-block; min-width: 1.25rem; margin-left: .35rem; padding: 0 .38rem; border-radius: 999px; background: var(--saffron); color: var(--ink); font-size: .7rem; font-weight: 800; line-height: 1.25rem; text-align: center; animation: badgePop .4s ease-out; }
@keyframes badgePop { from { transform: scale(.4); } to { transform: none; } }
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .35rem .75rem; margin-top: .4rem; }
.center { text-align: center; }

/* Reviews on the contract page */
.review-card { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.review-card:last-of-type { border-bottom: 0; }
.review-card p { margin: .4rem 0; }
.review-card__who { font-size: .85rem; color: var(--muted); }
.review-card__metrics { display: flex; flex-wrap: wrap; gap: .3rem 1rem; list-style: none; padding: 0; margin: .4rem 0 0; font-size: .85rem; color: var(--ink-soft); }
.review-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--line); }
.review-form h3 { margin: 0 0 .5rem; }
.rate-input { border: 0; padding: 0; margin: 0 0 1rem; }
.rate-input legend { font-weight: 700; margin-bottom: .35rem; }
/* Star picker: radios in reverse order so CSS can light up all stars up to the hovered one. */
.rate-input__stars { display: inline-flex; flex-direction: row-reverse; gap: .2rem; }
.rate-input__stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rate-input__stars label { cursor: pointer; color: #C9D2DA; transition: transform .15s, color .15s; }
.rate-input__stars label .icon { width: 2rem; height: 2rem; fill: currentColor; stroke: none; }
.rate-input__stars label:hover, .rate-input__stars label:hover ~ label, .rate-input__stars input:checked ~ label { color: #F2B233; }
.rate-input__stars label:hover { transform: scale(1.15); }
.rate-input__stars input:checked + label { animation: starPop .35s ease-out; }
.rate-input__stars input:focus-visible + label { box-shadow: var(--focus); border-radius: 6px; }
@keyframes starPop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: none; } }

/* ---------------- Chat ---------------- */
.chat { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - 150px); min-height: 520px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.chat__list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.chat__list-head { padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); }
.chat__list-head h1 { font-size: 1.2rem; margin: 0; }
.chat__empty, .chat__placeholder { display: grid; place-items: center; align-content: center; gap: .4rem; padding: 2rem; text-align: center; height: 100%; }
.chat__empty > .icon, .chat__placeholder > .icon { width: 2.4rem; height: 2.4rem; color: var(--ledger); }
.convos { list-style: none; margin: 0; padding: .4rem; overflow-y: auto; flex: 1; }
.convo { display: flex; gap: .7rem; align-items: center; padding: .7rem; border-radius: 10px; color: var(--ink); text-decoration: none; transition: background-color .15s; }
.convo:hover { background: var(--canvas); color: var(--ink); }
.convo.is-active { background: var(--ledger-tint); }
.convo__main { display: grid; min-width: 0; flex: 1; }
.convo__top { display: flex; justify-content: space-between; gap: .5rem; }
.convo__top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convo__top time { font-size: .75rem; color: var(--muted); font-weight: 500; flex: none; }
.convo__job, .convo__last { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.convo.has-unread .convo__last { color: var(--ink); font-weight: 700; }
.convo__badge { flex: none; min-width: 1.4rem; padding: 0 .4rem; border-radius: 999px; background: var(--ledger); color: #fff; font-size: .72rem; font-weight: 800; line-height: 1.4rem; text-align: center; }
.chat-avatar { position: relative; flex: none; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, #19A58E, #0E6B5C); color: #fff; font-weight: 800; font-size: .9rem; }
.chat-avatar--lg { width: 46px; height: 46px; }
.dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; background: #A3AEB9; }
.dot--online { background: #16A34A; }

.chat__thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.thread-head { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.thread-head__back { display: none; transform: rotate(180deg); color: var(--ink); }
.thread-head__who { display: grid; min-width: 0; }
.thread-head__job { margin-left: auto; color: var(--muted); }
.thread-body { flex: 1; overflow-y: auto; padding: 1rem 1.1rem; background: #F7F9FA; overscroll-behavior: contain; }
.thread-note { display: flex; gap: .5rem; align-items: flex-start; margin: 0 auto 1rem; max-width: 34rem; padding: .6rem .85rem; border-radius: 10px; background: var(--saffron-tint); color: #6B4A06; font-size: .82rem; }
.msgs { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.msgs__empty { text-align: center; padding: 1rem; }
.msg { display: grid; justify-items: start; max-width: 78%; }
.msg--mine { justify-self: end; justify-items: end; }
.msg__bubble { display: grid; gap: .4rem; padding: .65rem .85rem; border-radius: 14px 14px 14px 4px; background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0, 0, 0, .04); max-width: 100%; }
.msg--mine .msg__bubble { border-radius: 14px 14px 4px 14px; background: var(--ledger); border-color: var(--ledger); color: #fff; }
.msg__text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg__meta { display: flex; gap: .5rem; font-size: .72rem; color: var(--muted); margin-top: .2rem; }
.msg--new { animation: msgIn .35s ease-out; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.msg__image { display: block; border-radius: 10px; overflow: hidden; max-width: 280px; }
.msg__image img { display: block; width: 100%; height: auto; max-height: 260px; object-fit: cover; }
.msg__filemeta { font-size: .72rem; opacity: .8; }
.msg__file { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: 10px; background: rgba(14, 107, 92, .07); color: inherit; text-decoration: none; min-width: 0; }
.msg--mine .msg__file { background: rgba(255, 255, 255, .15); color: #fff; }
.msg__filename { display: grid; min-width: 0; font-size: .88rem; font-weight: 700; overflow-wrap: anywhere; }
.msg__filename small { font-weight: 500; opacity: .8; }
.msg__dl { margin-left: auto; }

.composer { border-top: 1px solid var(--line); padding: .7rem .9rem .6rem; background: var(--surface); }
.composer__row { display: flex; align-items: flex-end; gap: .5rem; }
.composer textarea { flex: 1; min-width: 0; resize: none; max-height: 180px; padding: .65rem .8rem; border: 1.5px solid var(--line); border-radius: 12px; font: inherit; line-height: 1.4; }
.composer textarea:focus { border-color: var(--ledger); outline: none; box-shadow: var(--focus); }
.composer__attach { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; border: 1.5px solid var(--line); color: var(--ink-soft); cursor: pointer; transition: border-color .15s, color .15s; }
.composer__attach:hover, .composer__attach:focus-within { border-color: var(--ledger); color: var(--ledger); }
.composer__attach input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.composer__send { width: 44px; height: 44px; padding: 0; border-radius: 12px; flex: none; }
.composer.is-sending .composer__send { animation: sendPulse 1s ease-in-out infinite; }
@keyframes sendPulse { 50% { opacity: .55; } }
.composer__hint { margin: .35rem 0 0; }
.composer__error { margin: 0 0 .5rem; padding: .5rem .75rem; border-radius: 8px; background: var(--danger-tint); color: var(--danger); font-size: .88rem; font-weight: 600; }
.composer__files { list-style: none; margin: 0 0 .5rem; padding: 0; display: grid; gap: .4rem; }
.composer__files:empty { display: none; }
.fchip { position: relative; display: flex; align-items: center; gap: .6rem; padding: .45rem .5rem; border-radius: 10px; border: 1px solid var(--line); background: #F7F9FA; overflow: hidden; }
.fchip__thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; flex: none; }
.fchip > .icon { width: 1.6rem; height: 1.6rem; color: var(--ledger); }
.fchip__info { display: grid; min-width: 0; flex: 1; font-size: .85rem; font-weight: 600; overflow-wrap: anywhere; }
.fchip__info small { color: var(--muted); font-weight: 500; }
.fchip__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: transparent; }
.fchip__fill { display: block; height: 100%; background: linear-gradient(90deg, #19A58E, #0E6B5C); transform: scaleX(0); transform-origin: left; transition: transform .2s linear; }
.fchip.is-uploading .fchip__bar { background: var(--line); }
.fchip.is-done .fchip__fill { transform: scaleX(1); }
.fchip__remove { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: .3rem; border-radius: 6px; }
.fchip__remove:hover { color: var(--danger); }

@media (max-width: 800px) {
    .page:has(.chat) { padding: 0; }
    .chat { grid-template-columns: 1fr; height: calc(100dvh - 120px); border-radius: 0; border-left: 0; border-right: 0; }
    .chat--thread .chat__list { display: none; }
    .chat:not(.chat--thread) .chat__thread { display: none; }
    .thread-head__back { display: inline-flex; }
    .thread-head__job { margin-left: 0; width: 100%; }
    .msg { max-width: 90%; }
}
@media (prefers-reduced-motion: reduce) {
    .msg--new, .nav-badge, .rate-input__stars input:checked + label { animation: none; }
}


/* ==========================================================
   GrowUp 1.2 components
   ========================================================== */
/* Avatars: photo or initials */
.ava { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; background: linear-gradient(135deg, #D9F2E9, #DCEBFB); color: var(--ledger-deep); font-weight: 800; overflow: visible; }
.ava img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.ava__initials { line-height: 1; }
.ava--xs { width: 28px; height: 28px; font-size: .7rem; }
.ava--sm { width: 36px; height: 36px; font-size: .8rem; }
.ava--md { width: 44px; height: 44px; font-size: .9rem; }
.ava--lg { width: 64px; height: 64px; font-size: 1.2rem; }
.ava--xl { width: 112px; height: 112px; font-size: 2rem; box-shadow: 0 0 0 4px #fff, var(--shadow-sm); }
.ava .dot { position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; background: #B8C2CF; }
.ava .dot--online { background: #22C55E; }

/* Repeatable rows (education, certifications) */
.rowset { display: grid; gap: .75rem; margin-top: .75rem; }
.rowset__row { display: grid; gap: .75rem; padding: .9rem; border: 1px dashed var(--line-strong); border-radius: 12px; background: #FBFCFD; }
.rowset__row--3 { grid-template-columns: 2fr 2fr 1fr; }
.rowset__row--4 { grid-template-columns: 2fr 1.5fr .8fr 1.6fr; }
@media (max-width: 760px) { .rowset__row--3, .rowset__row--4 { grid-template-columns: 1fr; } }

/* People rows with photo (shortlist, proposals, invitations) */
.person { display: flex; gap: .85rem; align-items: center; min-width: 0; }
.person__text { min-width: 0; }
.person__text .row__title { display: inline-block; }
.label { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 .35rem; }
.pill--gold { background: var(--saffron-tint); color: #7A5200; }
.pill--muted { background: var(--canvas); color: var(--muted); }

/* Portfolio management grid */
.pgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.pitem { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); display: flex; flex-direction: column; box-shadow: var(--shadow-xs); }
.pitem__img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: var(--canvas); }
.pitem__body { padding: .9rem 1rem 1rem; display: grid; gap: .35rem; }
.pitem__body p { margin: 0; }
.pitem__actions { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: .35rem; }

/* Empty states */
.empty { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-md); }
.empty > .icon { width: 2.4rem; height: 2.4rem; color: var(--ledger); margin-bottom: .5rem; }
.empty__actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.panel.empty { border-style: dashed; }

/* Settings */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .settings-grid { grid-template-columns: 1fr; } }

/* Admin category thumbnails */
.thumb { width: 72px; height: 48px; object-fit: cover; border-radius: 8px; background: var(--canvas); display: block; }
.thumb--lg { width: 100%; max-width: 360px; height: auto; aspect-ratio: 16 / 10; }
.mt-sm { margin-top: .5rem; }
/* Visually hidden radio/checkbox inputs stay inside their label (no phantom horizontal scroll). */
.chipcheck, .segmented label, .hero-search__type label { position: relative; }
.chipcheck input, .segmented input, .hero-search__type input { left: 0; top: 0; width: 1px; height: 1px; margin: 0; }
