/* =========================================================================
   FreelanceHub — modern design system
   Token-based, responsive, accessible. Light + dark (prefers-color-scheme).
   All legacy class names preserved so existing views render unchanged.
   ========================================================================= */

/* ---- Design tokens ---- */
:root {
    --brand:        #4f46e5;   /* indigo 600 */
    --brand-600:    #4338ca;
    --brand-700:    #3730a3;
    --brand-soft:   #eef2ff;
    --accent:       #0ea5e9;

    --ink:          #0f172a;   /* slate 900 */
    --ink-2:        #334155;   /* slate 700 */
    --muted:        #64748b;   /* slate 500 */
    --line:         #e2e8f0;   /* slate 200 */
    --line-2:       #cbd5e1;
    --bg:           #ffffff;
    --bg-2:         #f8fafc;   /* slate 50 */
    --surface:      #ffffff;

    --ok-bg:#ecfdf5; --ok-fg:#065f46; --ok-bd:#6ee7b7;
    --err-bg:#fef2f2; --err-fg:#991b1b; --err-bd:#fca5a5;
    --warn-bg:#fffbeb; --warn-fg:#92400e; --warn-bd:#fcd34d;
    --info-bg:#eff6ff; --info-fg:#1e40af; --info-bd:#93c5fd;

    --radius:   12px;
    --radius-sm: 8px;
    --radius-pill: 999px;
    --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.08);
    --shadow-md: 0 4px 12px rgba(15,23,42,.08), 0 2px 4px rgba(15,23,42,.04);
    --shadow-lg: 0 12px 32px rgba(15,23,42,.12);

    --space-1:4px; --space-2:8px; --space-3:12px; --space-4:16px;
    --space-5:24px; --space-6:32px; --space-7:48px; --space-8:64px;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --maxw: 1120px;
    --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ink:#e2e8f0; --ink-2:#cbd5e1; --muted:#94a3b8;
        --line:#1e293b; --line-2:#334155;
        --bg:#0b1120; --bg-2:#0f172a; --surface:#111a2e;
        --brand-soft:#1e1b4b;
        --ok-bg:#052e2b; --ok-fg:#6ee7b7; --ok-bd:#065f46;
        --err-bg:#3b0a0a; --err-fg:#fca5a5; --err-bd:#7f1d1d;
        --warn-bg:#3b2f05; --warn-fg:#fcd34d; --warn-bd:#78550c;
        --info-bg:#0b1e3b; --info-fg:#93c5fd; --info-bd:#1e40af;
        --shadow-sm:0 1px 2px rgba(0,0,0,.4);
        --shadow-md:0 4px 12px rgba(0,0,0,.5);
        --shadow-lg:0 12px 32px rgba(0,0,0,.6);
    }
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg-2);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
img, svg { max-width: 100%; display: block; }
h1,h2,h3,h4 { line-height: 1.25; color: var(--ink); font-weight: 700; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.35rem, 2.5vw, 1.75rem); letter-spacing: -.01em; margin-bottom: var(--space-4); }
h3 { font-size: 1.15rem; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
p { color: var(--ink-2); }
.muted { color: var(--muted); }
code { background: var(--bg-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; font-size: .875em; }

/* ---- Accessible focus + skip link ---- */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip-link {
    position: absolute; left: var(--space-3); top: -100px; z-index: 1000;
    background: var(--brand); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
    transition: top .15s ease;
}
.skip-link:focus { top: var(--space-3); text-decoration: none; }
.sr-only {
    position:absolute; width:1px; height:1px; padding:0; margin:-1px;
    overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

/* ---- Layout ---- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--space-4); }
main.container { flex: 1 0 auto; padding-top: var(--space-6); padding-bottom: var(--space-7); }

/* ---- Header / nav ---- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: var(--space-4); }
.brand { font-weight: 800; font-size: 1.3rem; color: var(--brand); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.main-nav { display: flex; align-items: center; gap: var(--space-1); flex-wrap: wrap; }
.main-nav a {
    color: var(--ink-2); padding: 8px 12px; border-radius: var(--radius-sm);
    font-size: .95rem; font-weight: 500; white-space: nowrap;
}
.main-nav a:hover { background: var(--bg-2); color: var(--ink); text-decoration: none; }
.main-nav .btn { color: #fff; }
.main-nav .btn:hover { color: #fff; }

/* Hamburger toggle (hidden on desktop) */
.nav-toggle {
    display: none; align-items: center; justify-content: center;
    width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface); cursor: pointer; color: var(--ink);
}
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 860px) {
    .nav-toggle { display: inline-flex; }
    .main-nav {
        position: fixed; inset: var(--header-h) 0 auto 0;
        flex-direction: column; align-items: stretch; gap: 2px;
        background: var(--surface); border-bottom: 1px solid var(--line);
        padding: var(--space-3); box-shadow: var(--shadow-lg);
        max-height: calc(100vh - var(--header-h)); overflow-y: auto;
        transform: translateY(-8px); opacity: 0; visibility: hidden;
        transition: opacity .18s ease, transform .18s ease, visibility .18s;
    }
    .main-nav.open { transform: translateY(0); opacity: 1; visibility: visible; }
    .main-nav a, .main-nav .linkbtn { padding: 12px 14px; width: 100%; text-align: left; font-size: 1rem; }
    .nav-logout { width: 100%; }
}

/* ---- Buttons ---- */
.btn, button[type="submit"], .search button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--brand); color: #fff; border: 1px solid transparent;
    padding: 10px 18px; border-radius: var(--radius-sm); font: inherit; font-weight: 600;
    cursor: pointer; transition: background .15s ease, transform .05s ease, box-shadow .15s ease;
    text-decoration: none; line-height: 1.2;
}
.btn:hover, button[type="submit"]:hover, .search button:hover { background: var(--brand-600); text-decoration: none; box-shadow: var(--shadow-sm); }
.btn:active, button[type="submit"]:active { transform: translateY(1px); }
.btn-block { width: 100%; padding: 12px; }
.btn-outline {
    background: transparent; color: var(--brand); border: 1px solid var(--line-2);
    padding: 9px 16px; border-radius: var(--radius-sm); font: inherit; font-weight: 600; cursor: pointer;
}
.btn-outline:hover { border-color: var(--brand); background: var(--brand-soft); text-decoration: none; }
.linkbtn { background: none; border: 0; color: var(--ink-2); cursor: pointer; font: inherit; padding: 8px 12px; border-radius: var(--radius-sm); }
.linkbtn:hover { background: var(--bg-2); color: var(--ink); }
.linkbtn.err { color: #dc2626; }

/* ---- Hero + search ---- */
.hero {
    text-align: center; padding: var(--space-8) var(--space-4);
    background: radial-gradient(1200px 400px at 50% -10%, var(--brand-soft), transparent);
    border-radius: var(--radius); margin-bottom: var(--space-6);
}
.hero h1 { margin-bottom: var(--space-3); max-width: 20ch; margin-inline: auto; }
.hero p { font-size: 1.1rem; color: var(--muted); max-width: 52ch; margin-inline: auto; }
.search { display: flex; gap: var(--space-2); justify-content: center; margin-top: var(--space-5); flex-wrap: wrap; }
.search input {
    flex: 1 1 380px; max-width: 480px; padding: 13px 16px;
    border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit;
}

/* ---- Category + card grids ---- */
.categories { padding: var(--space-4) 0; }
.category-grid, .card-list {
    list-style: none; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-4);
}
.category-grid a {
    display: block; padding: var(--space-5); background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font-weight: 600;
    box-shadow: var(--shadow-sm); transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.category-grid a:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--brand); text-decoration: none; }

.listing-card {
    padding: var(--space-5); background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.listing-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-2); }
.listing-card a { color: var(--ink); }
.price { font-weight: 700; color: var(--ink); }

/* ---- Filters ---- */
.filters { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; margin: var(--space-4) 0 var(--space-6); }
.filters select, .filters input {
    padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink); font: inherit;
}

/* ---- Cards / dashboards ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: var(--space-4); margin: var(--space-5) 0; }
.card {
    padding: var(--space-5); background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm);
    transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--brand); text-decoration: none; }

/* ---- Forms ---- */
.auth-card, .form-page, .account, .manage, .detail, .cms-page, .blog, .wallet, .admin, .profile, .thread, .search, .categories, .listing, .directory, .error-page {
    background: transparent;
}
.auth-card {
    max-width: 440px; margin: var(--space-7) auto; padding: var(--space-6);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md);
}
.form-page { max-width: 680px; }
.auth-card label, .account label, .form-page label {
    display: block; margin: var(--space-4) 0 0; font-weight: 600; color: var(--ink); font-size: .95rem;
}
.auth-card input, .auth-card select, .auth-card textarea,
.account input, .account select, .account textarea,
.form-page input, .form-page select, .form-page textarea,
.reply-form textarea {
    display: block; width: 100%; margin-top: var(--space-2); padding: 11px 13px;
    border: 1px solid var(--line-2); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink); font: inherit; font-weight: 400;
}
.auth-card input:focus, .account input:focus, .form-page input:focus,
.auth-card textarea:focus, .account textarea:focus, .form-page textarea:focus,
.auth-card select:focus, .account select:focus, .form-page select:focus {
    border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft);
}
.row { display: flex; gap: var(--space-4); flex-wrap: wrap; }
.row label { flex: 1; min-width: 160px; }
.auth-alt { text-align: center; margin-top: var(--space-4); color: var(--muted); }
.err { color: #dc2626; font-weight: 500; font-size: .875rem; display: block; margin-top: 4px; }
fieldset.skills { border: 1px solid var(--line); border-radius: var(--radius); margin: var(--space-4) 0; padding: var(--space-3) var(--space-4); }
fieldset.skills legend { font-weight: 600; padding: 0 var(--space-2); }
.checkbox { display: inline-flex; align-items: center; gap: 6px; margin: 6px 14px 6px 0; font-weight: 400; }
.checkbox input { width: auto; display: inline; margin: 0; }

/* ---- Flash ---- */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: var(--space-3); border: 1px solid; font-weight: 500; }
.flash-success { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-bd); }
.flash-error { background: var(--err-bg); color: var(--err-fg); border-color: var(--err-bd); }

/* ---- Badges ---- */
.badge { display: inline-block; font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-pill); background: var(--bg-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge-accepted, .badge-completed { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-bd); }
.badge-rejected, .badge-cancelled { background: var(--err-bg); color: var(--err-fg); border-color: var(--err-bd); }
.badge-pending, .badge-delivered { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-bd); }
.badge-active { background: var(--info-bg); color: var(--info-fg); border-color: var(--info-bd); }

/* ---- Tags ---- */
.tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tag { background: var(--brand-soft); color: var(--brand-700); padding: 4px 12px; border-radius: var(--radius-pill); font-size: .9rem; font-weight: 500; }

/* ---- Tables (responsive) ---- */
.admin-table { width: 100%; border-collapse: collapse; margin: var(--space-4) 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.admin-table th, .admin-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.admin-table th { background: var(--bg-2); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr:hover td { background: var(--bg-2); }
@media (max-width: 640px) {
    .admin-table, .admin-table thead, .admin-table tbody, .admin-table th, .admin-table td, .admin-table tr { display: block; }
    .admin-table thead { position: absolute; left: -9999px; }
    .admin-table tr { margin-bottom: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
    .admin-table td { border: 0; border-bottom: 1px solid var(--line); padding-left: 42%; position: relative; min-height: 44px; }
    .admin-table td::before { content: attr(data-label); position: absolute; left: 12px; top: 12px; width: 38%; font-weight: 600; color: var(--muted); font-size: .8rem; }
}

/* ---- Header/manage utility rows ---- */
.manage-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.inline-form { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; margin-bottom: var(--space-3); }
.inline-form input, .inline-form select { padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; }

/* ---- Detail / crumbs / buybox ---- */
.detail { max-width: 820px; }
.crumbs { color: var(--muted); margin-bottom: var(--space-3); font-size: .9rem; }
.crumbs a { color: var(--muted); }
.detail-body, .post-body, .page-body { margin: var(--space-5) 0; line-height: 1.75; color: var(--ink-2); }
.buybox { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); max-width: 320px; background: var(--surface); box-shadow: var(--shadow-sm); }

/* ---- Pagination ---- */
.pagination { display: flex; gap: var(--space-4); align-items: center; margin-top: var(--space-5); justify-content: center; }
.pagination a { padding: 8px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); color: var(--ink-2); }
.pagination a:hover { border-color: var(--brand); background: var(--brand-soft); text-decoration: none; }

/* ---- Profiles ---- */
.profile-head { padding-bottom: var(--space-4); border-bottom: 1px solid var(--line); margin-bottom: var(--space-5); }
.headline { font-size: 1.15rem; color: var(--ink-2); margin-top: var(--space-1); }
.profile-list { list-style: none; padding: 0; }
.profile-item { padding: var(--space-4) 0; border-bottom: 1px solid var(--line); }
.review-list { list-style: none; padding: 0; }
.review { border-top: 1px solid var(--line); padding: var(--space-4) 0; }
.review-head { display: flex; justify-content: space-between; align-items: center; }
.stars { color: #d97706; font-weight: 600; }

/* ---- Wallet ---- */
.balance-box { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); margin: var(--space-4) 0; max-width: 340px; background: linear-gradient(135deg, var(--brand-soft), var(--surface)); box-shadow: var(--shadow-sm); }
.balance { font-size: 2.25rem; font-weight: 800; margin-top: var(--space-1); color: var(--ink); }

/* ---- Orders / disputes ---- */
.order-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; margin: var(--space-5) 0; }
.order-actions form { display: inline; }
.dispute-box { border: 1px solid var(--warn-bd); background: var(--warn-bg); border-radius: var(--radius); padding: var(--space-4); margin: var(--space-4) 0; }
.dispute-box h2 { margin-bottom: var(--space-2); }
.proposal-list { list-style: none; padding: 0; }
.proposal { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-4); margin-bottom: var(--space-3); background: var(--surface); box-shadow: var(--shadow-sm); }
.proposal-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }

/* ---- Messaging ---- */
.messages { display: flex; flex-direction: column; gap: var(--space-2); margin: var(--space-4) 0; }
.msg { max-width: 75%; padding: 10px 14px; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.msg-me { align-self: flex-end; background: var(--brand); color: #fff; }
.msg-me .msg-meta { color: rgba(255,255,255,.8); }
.msg-them { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); }
.msg-meta { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.reply-form { display: flex; flex-direction: column; gap: var(--space-2); }
.conversation-list { list-style: none; padding: 0; }
.conversation-list li a { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: var(--space-2); color: var(--ink); background: var(--surface); }
.conversation-list li a:hover { border-color: var(--brand); text-decoration: none; box-shadow: var(--shadow-sm); }

/* ---- Notifications ---- */
.notification-list { list-style: none; padding: 0; }
.notification { padding: 14px; border-bottom: 1px solid var(--line); display: flex; gap: var(--space-3); align-items: baseline; }
.notification.unread { background: var(--brand-soft); border-radius: var(--radius-sm); }
.n-when { min-width: 104px; font-size: .82rem; color: var(--muted); }

/* ---- Blog ---- */
.post-list { list-style: none; padding: 0; }
.post-card { padding: var(--space-5) 0; border-bottom: 1px solid var(--line); }
.post-card h2 { margin-bottom: 6px; }
.post-card h2 a { color: var(--ink); }
.post .cover { width: 100%; border-radius: var(--radius); margin: var(--space-4) 0; box-shadow: var(--shadow-sm); }

/* ---- Error pages ---- */
.error-page { text-align: center; padding: var(--space-8) 0; }
.error-page h1 { font-size: clamp(3rem, 12vw, 5rem); color: var(--brand); }

/* ---- Footer ---- */
.site-footer { flex-shrink: 0; border-top: 1px solid var(--line); margin-top: var(--space-7); padding: var(--space-6) 0; background: var(--surface); color: var(--muted); }
.footer-nav { display: flex; gap: var(--space-5); flex-wrap: wrap; margin-bottom: var(--space-3); }
.footer-nav a { color: var(--muted); }
.footer-nav a:hover { color: var(--brand); }

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---- Homepage sections ---- */
.hero-cta { margin-top: var(--space-5); display: flex; gap: var(--space-3); justify-content: center; flex-wrap: wrap; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }

.stats {
    display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: center;
    margin: var(--space-6) 0; padding: var(--space-5); background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.stat { text-align: center; flex: 1 1 140px; }
.stat-num { display: block; font-size: 2rem; font-weight: 800; color: var(--brand); line-height: 1.1; }
.stat-label { color: var(--muted); font-size: .9rem; }

.home-section { margin: var(--space-7) 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.section-head h2 { margin: 0; }

.job-list { list-style: none; padding: 0; display: grid; gap: var(--space-3); }
.job-row {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
    padding: var(--space-4) var(--space-5); background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.job-row:hover { border-color: var(--line-2); box-shadow: var(--shadow-md); }
.job-budget { font-weight: 700; white-space: nowrap; }

.talent-card { display: flex; gap: var(--space-4); align-items: flex-start; }
.avatar {
    flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%;
    display: grid; place-items: center; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--accent));
}

.how-it-works { margin: var(--space-8) 0; text-align: center; }
.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-5); margin-top: var(--space-5); text-align: left; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); box-shadow: var(--shadow-sm); }
.step-num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-700); font-weight: 800; margin-bottom: var(--space-3); }
.steps h3 { margin-bottom: var(--space-2); }

.home-final-cta { text-align: center; padding: var(--space-8) var(--space-4); margin: var(--space-7) 0 0; background: radial-gradient(900px 300px at 50% 120%, var(--brand-soft), transparent); border-radius: var(--radius); }
.home-final-cta p { margin: var(--space-2) 0 var(--space-5); color: var(--muted); }

@media (max-width: 560px) {
    .job-row { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
}

/* ---- Homepage look & feel enhancements ---- */
.hero {
    background:
        radial-gradient(900px 380px at 15% -20%, color-mix(in srgb, var(--brand) 22%, transparent), transparent),
        radial-gradient(900px 380px at 85% -20%, color-mix(in srgb, var(--accent) 20%, transparent), transparent),
        var(--surface);
    border: 1px solid var(--line);
}
.hero-eyebrow {
    display: inline-block; margin-bottom: var(--space-3);
    background: var(--brand-soft); color: var(--brand-700);
    padding: 6px 14px; border-radius: var(--radius-pill);
    font-size: .82rem; font-weight: 600; letter-spacing: .01em;
}

/* Icon category cards */
.category-grid a {
    display: flex; align-items: center; gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
}
.cat-icon {
    flex: 0 0 auto; width: 44px; height: 44px; border-radius: var(--radius-sm);
    display: grid; place-items: center; font-size: 1.4rem;
    background: var(--brand-soft);
}
.cat-name { font-weight: 600; }

/* Gig cards with gradient cover + price chip */
.gig-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow-sm);
    transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
    display: flex; flex-direction: column;
}
.gig-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.gig-cover {
    display: flex; align-items: flex-end; height: 120px; padding: var(--space-3);
    text-decoration: none;
}
.gig-cover-cat {
    background: rgba(255,255,255,.9); color: #0f172a; font-size: .75rem; font-weight: 700;
    padding: 3px 10px; border-radius: var(--radius-pill);
}
.gig-body { padding: var(--space-4); display: flex; flex-direction: column; gap: 4px; flex: 1; }
.gig-title { color: var(--ink); font-weight: 600; line-height: 1.35; }
.gig-title:hover { color: var(--brand); text-decoration: none; }
.gig-seller { font-size: .88rem; margin: 0; }
.gig-meta { margin-top: auto; padding-top: var(--space-3); display: flex; align-items: center; justify-content: space-between; }
.price-chip { background: var(--brand-soft); color: var(--brand-700); font-weight: 700; padding: 4px 12px; border-radius: var(--radius-pill); }

/* Larger talent avatars */
.talent-card .avatar { width: 52px; height: 52px; font-size: 1.25rem; }

/* Stats: 4-up now */
.stat { flex: 1 1 120px; }

/* =========================================================================
   Admin dashboard layout
   ========================================================================= */
.admin-body { background: var(--bg-2); }
.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
    flex: 0 0 240px; width: 240px; background: var(--surface);
    border-right: 1px solid var(--line); padding: var(--space-4);
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    display: flex; flex-direction: column;
}
.admin-sidebar .admin-sidebar-foot { margin-top: auto; }
.admin-brand { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-2) var(--space-5); }
.admin-brand a { font-weight: 800; font-size: 1.15rem; color: var(--brand); }
.admin-badge { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; background: var(--brand-soft); color: var(--brand-700); padding: 2px 8px; border-radius: var(--radius-pill); }
.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav-link {
    position: relative;
    display: flex; align-items: center; gap: var(--space-3); padding: 10px 12px;
    border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 500;
    transition: background .12s ease, color .12s ease;
}
.admin-nav-link:hover { background: var(--bg-2); color: var(--ink); text-decoration: none; }
.admin-nav-link.is-active { background: var(--brand-soft); color: var(--brand-700); font-weight: 600; }
.admin-nav-link.is-active::before {
    content: ""; position: absolute; left: -4px; top: 50%; transform: translateY(-50%);
    width: 3px; height: 60%; border-radius: 3px; background: var(--brand);
}
.admin-nav-icon { width: 20px; text-align: center; }
.admin-nav-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 0 12px; margin: var(--space-3) 0 var(--space-1); }
.admin-sidebar-foot { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--line); }
.admin-sidebar-foot a { display: flex; align-items: center; gap: var(--space-2); padding: 10px 12px; border-radius: var(--radius-sm); color: var(--muted); font-size: .9rem; }
.admin-sidebar-foot a:hover { background: var(--bg-2); color: var(--ink); text-decoration: none; }

.admin-content { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
    padding: var(--space-3) var(--space-5); background: var(--surface);
    border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.admin-topbar-actions { display: flex; align-items: center; gap: var(--space-3); margin-left: auto; }
.admin-topbar-link { color: var(--ink-2); font-weight: 500; }
.admin-topbar .nav-toggle { display: none; }
.admin-main { padding: var(--space-6) var(--space-5); flex: 1; max-width: 1100px; width: 100%; }

.admin-page-head { margin-bottom: var(--space-5); }
.admin-page-head h1 { margin-bottom: 2px; }

.admin-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-6); }
.admin-stat {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: var(--space-4); box-shadow: var(--shadow-sm);
    display: grid; grid-template-columns: auto 1fr; gap: var(--space-1) var(--space-3); align-items: center;
}
.admin-stat-icon { grid-row: 1 / span 2; width: 44px; height: 44px; border-radius: var(--radius-sm); background: var(--brand-soft); display: grid; place-items: center; font-size: 1.35rem; }
.admin-stat-num { font-size: 1.6rem; font-weight: 800; color: var(--ink); line-height: 1.1; display: block; }
.admin-stat-label { color: var(--muted); font-size: .85rem; }
.admin-stat small, .admin-stat a { grid-column: 1 / -1; font-size: .8rem; }
.admin-stat-alert { border-color: var(--warn-bd); background: var(--warn-bg); }

.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); align-items: start; }
.admin-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); box-shadow: var(--shadow-sm); }
.admin-panel h2 { font-size: 1.15rem; margin-bottom: var(--space-4); }
.admin-panel .admin-table { border: 0; box-shadow: none; }
.admin-quicklinks { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.admin-quicklinks a { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink); }
.admin-quicklinks a:hover { border-color: var(--brand); background: var(--brand-soft); text-decoration: none; }

/* Admin CRUD views wrap content in .admin — normalize spacing inside the shell */
.admin-main .admin > h1 { margin-bottom: var(--space-4); }
.admin-main .admin { max-width: none; }

@media (max-width: 900px) {
    .admin-grid { grid-template-columns: 1fr; }
    .admin-topbar .nav-toggle { display: inline-flex; }
    .admin-sidebar {
        position: fixed; left: 0; top: 0; z-index: 60; height: 100vh;
        transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg);
    }
    .admin-sidebar.open { transform: translateX(0); }
}

/* Admin page header with an action button on the right */
.admin-page-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.admin-panel + .admin-panel { margin-top: var(--space-4); }
.admin-panel h2 { font-size: 1.05rem; }
.admin-main .form-page { max-width: 720px; }

/* ---- Search page ---- */
.search-hero {
    text-align: center; padding: var(--space-6) var(--space-4) var(--space-5);
    background: radial-gradient(800px 300px at 50% -30%, var(--brand-soft), transparent);
    border-radius: var(--radius); margin-bottom: var(--space-5);
}
.search-hero h1 { margin-bottom: var(--space-4); }
.search-bar { display: flex; gap: var(--space-2); justify-content: center; flex-wrap: wrap; }
.search-bar input[type="search"] {
    flex: 1 1 420px; max-width: 520px; padding: 13px 16px;
    border: 1px solid var(--line-2); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink); font: inherit;
}
.search-bar input[type="search"]:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.search-chips { display: inline-flex; gap: var(--space-2); flex-wrap: wrap; justify-content: center; margin-top: var(--space-4); }
.search-chip {
    padding: 8px 16px; border-radius: var(--radius-pill); border: 1px solid var(--line-2);
    color: var(--ink-2); font-weight: 600; font-size: .9rem; background: var(--surface);
}
.search-chip:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.search-chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

.search-summary { margin-bottom: var(--space-4); }
.search-empty { text-align: center; padding: var(--space-7) var(--space-4); }
.search-empty-icon { font-size: 3rem; margin-bottom: var(--space-2); }
.search-empty h3 { margin: var(--space-6) 0 var(--space-4); }
.search-empty .category-grid { text-align: left; max-width: 760px; margin: 0 auto; }

/* ---- Listing pages (services / jobs / talent) ---- */
.listing-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.listing-head h1 { margin-bottom: 2px; }

.filter-bar {
    display: flex; gap: var(--space-4); align-items: flex-end; flex-wrap: wrap;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: var(--space-4); box-shadow: var(--shadow-sm); margin-bottom: var(--space-5);
}
.filter-field { display: flex; flex-direction: column; gap: 4px; }
.filter-field label { font-size: .8rem; font-weight: 600; color: var(--muted); }
.filter-field select, .filter-field input {
    padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink); font: inherit; min-width: 150px;
}
.filter-field select:focus, .filter-field input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.filter-actions { display: flex; gap: var(--space-2); align-items: center; margin-left: auto; }

/* Seller line with small avatar inside gig cards */
.gig-seller { display: flex; align-items: center; gap: 8px; margin: 0; }
.mini-avatar {
    flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
    display: grid; place-items: center; color: #fff; font-size: .72rem; font-weight: 700;
}

@media (max-width: 560px) {
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-field select, .filter-field input { width: 100%; min-width: 0; }
    .filter-actions { margin-left: 0; }
    .filter-actions .btn { flex: 1; }
}

/* ---- Job cards (Find Work listing) ---- */
.job-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: var(--space-4); box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column; gap: var(--space-3);
    transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.job-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-2); }
.job-card-top { display: flex; gap: var(--space-3); align-items: flex-start; }
.job-card-top .mini-avatar { width: 40px; height: 40px; font-size: .95rem; }
.job-card-title { color: var(--ink); font-weight: 600; line-height: 1.35; display: block; }
.job-card-title:hover { color: var(--brand); text-decoration: none; }
.job-card-client { margin: 2px 0 0; font-size: .88rem; }
.job-card-meta { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-top: auto; }
.job-card-date { margin-left: auto; }

/* ---- Talent directory (Find Talent) ---- */
.talent-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-4); }
.talent-tile {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: var(--space-5); box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column; gap: var(--space-3);
    transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.talent-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-2); }
.talent-tile-head { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 0 var(--space-3); align-items: center; color: var(--ink); }
.talent-tile-head:hover { text-decoration: none; }
.avatar-lg { grid-row: 1 / span 2; width: 56px; height: 56px; font-size: 1.4rem; }
.talent-name { font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.talent-tile-head:hover .talent-name { color: var(--brand); }
.talent-rating { font-size: .85rem; color: var(--ink-2); }
.talent-rating .stars { color: #d97706; }
.talent-headline { color: var(--ink-2); margin: 0; font-size: .95rem; }
.talent-meta { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin: 0; font-size: .9rem; }
.talent-tags { margin: 0; }
.talent-tags .tag { font-size: .78rem; }
.tag-more { background: var(--line); color: var(--muted); }
.talent-cta { margin-top: auto; text-align: center; }

/* ---- Categories index ---- */
.cat-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-4); }
.cat-tile {
    display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-5);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    color: var(--ink); box-shadow: var(--shadow-sm);
    transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.cat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--brand); text-decoration: none; }
.cat-tile-icon { width: 52px; height: 52px; border-radius: var(--radius-sm); background: var(--brand-soft); display: grid; place-items: center; font-size: 1.6rem; }
.cat-tile-name { font-weight: 700; font-size: 1.1rem; }
.cat-tile-meta { font-size: .85rem; }

/* ---- Category show header ---- */
.cat-header { display: flex; align-items: center; gap: var(--space-4); margin: var(--space-3) 0 var(--space-5); }
.cat-header-icon { width: 64px; height: 64px; border-radius: var(--radius); background: var(--brand-soft); display: grid; place-items: center; font-size: 2rem; flex: 0 0 auto; }
.cat-header h1 { margin-bottom: 2px; }
.cat-subs { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-5); }

/* ---- Skills directory ---- */
.skill-cloud { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-3); }
.skill-chip {
    display: inline-flex; align-items: center; gap: var(--space-2);
    padding: 10px 16px; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-pill); color: var(--ink); font-weight: 600;
    box-shadow: var(--shadow-sm); transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease;
}
.skill-chip:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--shadow-md); text-decoration: none; }
.skill-chip-count { background: var(--brand-soft); color: var(--brand-700); font-size: .78rem; padding: 2px 9px; border-radius: var(--radius-pill); }
.tag-active { background: var(--brand); color: #fff; }

/* ---- Gig / service detail ---- */
.gig-detail { display: grid; grid-template-columns: 1fr 340px; gap: var(--space-6); align-items: start; margin-top: var(--space-3); }
.gig-detail-main { min-width: 0; }
.gig-hero { height: 220px; border-radius: var(--radius); display: flex; align-items: flex-end; padding: var(--space-4); margin-bottom: var(--space-4); box-shadow: var(--shadow-sm); }
.gig-hero-cat { background: rgba(255,255,255,.92); color: #0f172a; font-size: .8rem; font-weight: 700; padding: 4px 12px; border-radius: var(--radius-pill); }
.gig-byline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: var(--space-2) 0 var(--space-5); color: var(--muted); }
.gig-section { margin-bottom: var(--space-6); }
.gig-section h2 { font-size: 1.2rem; margin-bottom: var(--space-3); }

.gig-detail-side { display: flex; flex-direction: column; gap: var(--space-4); position: sticky; top: calc(var(--header-h) + var(--space-4)); }
.order-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); box-shadow: var(--shadow-md); }
.order-card-price { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-4); flex-wrap: wrap; }
.price-big { font-size: 2rem; font-weight: 800; color: var(--ink); }
.order-card-feats { list-style: none; padding: 0; margin: 0 0 var(--space-4); display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); font-size: .9rem; }
.btn-block.btn-outline { display: block; text-align: center; }

.seller-card { display: flex; align-items: center; gap: var(--space-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-4); box-shadow: var(--shadow-sm); }

@media (max-width: 860px) {
    .gig-detail { grid-template-columns: 1fr; }
    .gig-detail-side { position: static; }
}

/* ---- Public profile detail ---- */
.profile-hero {
    display: flex; align-items: center; gap: var(--space-5); flex-wrap: wrap;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: var(--space-5); box-shadow: var(--shadow-sm); margin: var(--space-3) 0 var(--space-5);
}
.profile-hero-avatar { width: 88px; height: 88px; font-size: 2.2rem; flex: 0 0 auto; }
.profile-hero-info { flex: 1 1 260px; min-width: 0; }
.profile-hero-info h1 { margin-bottom: 2px; }
.profile-hero .headline { color: var(--ink-2); font-size: 1.05rem; margin-bottom: var(--space-2); }
.profile-hero-meta { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.profile-hero-meta .stars { color: #d97706; }
.profile-hero-actions { flex: 0 0 auto; }

.profile-body { display: grid; grid-template-columns: 1fr 300px; gap: var(--space-5); align-items: start; }
.profile-main { min-width: 0; }
.profile-section { margin-bottom: var(--space-6); }
.profile-section h2 { font-size: 1.2rem; margin-bottom: var(--space-3); }
.profile-side { display: flex; flex-direction: column; gap: var(--space-4); position: sticky; top: calc(var(--header-h) + var(--space-4)); }
.profile-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); box-shadow: var(--shadow-sm); }
.profile-card h2 { font-size: 1.05rem; margin-bottom: var(--space-3); }
.profile-dl { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2) var(--space-4); margin: 0; }
.profile-dl dt { color: var(--muted); font-size: .9rem; }
.profile-dl dd { margin: 0; font-weight: 600; text-align: right; }
/* Clickable skill tags */
a.tag { text-decoration: none; }
a.tag:hover { background: var(--brand); color: #fff; }

@media (max-width: 860px) {
    .profile-body { grid-template-columns: 1fr; }
    .profile-side { position: static; }
    .profile-hero-actions { width: 100%; }
    .profile-hero-actions .btn { width: 100%; }
}

/* ---- Job detail header ---- */
.job-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.job-detail-head h1 { margin: 0; }

/* ---- Static content pages (About / Privacy / Terms / Contact) ---- */
.static-page { max-width: 760px; margin: 0 auto; }
.static-hero { padding: var(--space-4) 0 var(--space-5); border-bottom: 1px solid var(--line); margin-bottom: var(--space-5); }
.static-hero h1 { margin-bottom: var(--space-2); }
.static-lede { font-size: 1.1rem; color: var(--muted); }
.static-body { line-height: 1.75; }
.static-body h2 { font-size: 1.25rem; margin: var(--space-6) 0 var(--space-2); }
.static-body p, .static-body ul, .static-body ol { margin-bottom: var(--space-4); color: var(--ink-2); }
.static-body ul, .static-body ol { padding-left: var(--space-5); }
.static-body li { margin-bottom: 6px; }

/* ---- Enhanced static pages ---- */
.static-hero-lg {
    text-align: center; padding: var(--space-8) var(--space-4) var(--space-6);
    background: radial-gradient(900px 380px at 50% -20%, var(--brand-soft), transparent);
    border-radius: var(--radius); margin-bottom: var(--space-6);
}
.static-hero-lg h1 { margin-bottom: var(--space-2); }
.static-hero-lg .static-lede { max-width: 56ch; margin: 0 auto; font-size: 1.1rem; color: var(--muted); }
.static-hero-lg .hero-eyebrow { margin-bottom: var(--space-3); }
.static-section-title { text-align: center; margin: var(--space-7) 0 var(--space-4); }

.feature-cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4); }
.feature-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); box-shadow: var(--shadow-sm); }
.feature-card .feature-ic { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: var(--radius-sm); background: var(--brand-soft); font-size: 1.5rem; margin-bottom: var(--space-3); }
.feature-card h3 { margin-bottom: 6px; }
.feature-card p { margin-bottom: var(--space-2); font-size: .95rem; }

.static-cta { text-align: center; padding: var(--space-7) var(--space-4); margin-top: var(--space-7); background: radial-gradient(700px 260px at 50% 120%, var(--brand-soft), transparent); border-radius: var(--radius); }
.static-cta p { color: var(--muted); }
.static-cta-actions { display: flex; gap: var(--space-3); justify-content: center; flex-wrap: wrap; margin-top: var(--space-4); }

/* Legal pages: TOC + body */
.legal-layout { display: grid; grid-template-columns: 240px 1fr; gap: var(--space-6); align-items: start; max-width: 960px; margin: 0 auto; }
.legal-toc { position: sticky; top: calc(var(--header-h) + var(--space-4)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-4); box-shadow: var(--shadow-sm); }
.legal-toc-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin-bottom: var(--space-2); }
.legal-toc ol { margin: 0; padding-left: var(--space-4); display: flex; flex-direction: column; gap: 6px; }
.legal-toc a { color: var(--ink-2); font-size: .9rem; }
.legal-body h2 { scroll-margin-top: calc(var(--header-h) + var(--space-4)); }

@media (max-width: 780px) {
    .legal-layout { grid-template-columns: 1fr; }
    .legal-toc { position: static; }
}

/* ---- Blog index ---- */
.blog-hero { text-align: center; padding: var(--space-7) var(--space-4) var(--space-6); background: radial-gradient(900px 340px at 50% -20%, var(--brand-soft), transparent); border-radius: var(--radius); margin-bottom: var(--space-6); }
.blog-hero h1 { max-width: 22ch; margin: var(--space-2) auto; }
.blog-hero .static-lede { max-width: 52ch; margin: 0 auto; color: var(--muted); }

.post-meta { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.post-author { display: inline-flex; align-items: center; gap: 6px; }

/* Featured latest post */
.blog-featured {
    display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; margin-bottom: var(--space-6);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow-sm); color: var(--ink);
    transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.blog-featured:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-2); text-decoration: none; }
.blog-featured-cover { position: relative; min-height: 240px; display: block; }
.blog-featured-tag { position: absolute; top: var(--space-3); left: var(--space-3); background: rgba(255,255,255,.92); color: #0f172a; font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: var(--radius-pill); }
.blog-featured-body { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-6); }
.blog-featured-title { font-size: 1.6rem; font-weight: 800; line-height: 1.2; color: var(--ink); }
.blog-featured-excerpt { line-height: 1.6; }
.blog-readmore { color: var(--brand); font-weight: 600; margin-top: var(--space-2); }

/* Post grid */
.blog-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-5); }
.blog-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease; }
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-2); }
.blog-card-cover { display: block; height: 140px; }
.blog-card-body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.blog-card-title { font-size: 1.15rem; line-height: 1.3; margin: 0; }
.blog-card-title a { color: var(--ink); }
.blog-card-title a:hover { color: var(--brand); }

@media (max-width: 720px) {
    .blog-featured { grid-template-columns: 1fr; }
    .blog-featured-cover { min-height: 160px; }
}

/* ---- Blog article (post detail) ---- */
.article-hero { border-radius: var(--radius); padding: var(--space-7) var(--space-5); margin-bottom: var(--space-5); box-shadow: var(--shadow-sm); }
.article-hero-inner { max-width: 760px; margin: 0 auto; }
.article-hero h1 { color: #fff; margin: var(--space-3) 0; text-shadow: 0 1px 2px rgba(0,0,0,.2); }
.crumbs-light a { color: rgba(255,255,255,.9); }
.article-meta { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; color: rgba(255,255,255,.92); font-size: .9rem; }
.article-meta .mini-avatar { color: #fff; }

.article-wrap { max-width: 720px; margin: 0 auto; }
.article-cover { width: 100%; border-radius: var(--radius); margin-bottom: var(--space-5); box-shadow: var(--shadow-sm); }
.article-lede { font-size: 1.2rem; line-height: 1.6; color: var(--ink-2); font-weight: 500; margin-bottom: var(--space-5); padding-bottom: var(--space-4); border-bottom: 1px solid var(--line); }
.article-body { font-size: 1.075rem; line-height: 1.85; color: var(--ink-2); }
.article-body p { margin-bottom: var(--space-4); }
.article-body h2 { font-size: 1.4rem; margin: var(--space-6) 0 var(--space-3); color: var(--ink); }
.article-body h3 { font-size: 1.15rem; margin: var(--space-5) 0 var(--space-2); color: var(--ink); }
.article-body a { text-decoration: underline; }

.article-footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-7); padding-top: var(--space-5); border-top: 1px solid var(--line); }
.author-card { display: flex; align-items: center; gap: var(--space-3); }

/* ---- Auth pages (login / register / forgot / reset) ---- */
.auth-card-wide { max-width: 520px; }
.auth-head { text-align: center; margin-bottom: var(--space-5); }
.auth-logo { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: var(--radius); background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; font-weight: 800; font-size: 1.5rem; margin-bottom: var(--space-3); }
.auth-head h1 { font-size: 1.6rem; margin-bottom: 4px; }
.auth-head p { margin: 0; }

/* Standalone label + input pattern (register/login/reset) */
.auth-card > form label,
.auth-card > form .row > div > label {
    display: block; font-weight: 600; font-size: .9rem; margin: var(--space-3) 0 4px;
}
.auth-card > form > input,
.auth-card > form .row input {
    display: block; width: 100%; padding: 11px 13px; margin: 0;
    border: 1px solid var(--line-2); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink); font: inherit;
}
.auth-card > form > input:focus,
.auth-card > form .row input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.auth-card .row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.auth-card .btn-block { margin-top: var(--space-4); }
.auth-card .err { margin-top: 4px; }

/* Role toggle (register) */
.role-toggle { border: 0; padding: 0; margin: 0 0 var(--space-2); }
.role-toggle legend { font-weight: 600; font-size: .9rem; margin-bottom: var(--space-2); padding: 0; }
.role-option { display: block; cursor: pointer; margin-bottom: var(--space-2); }
.role-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.role-card {
    display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
    gap: 0 var(--space-3); align-items: center;
    border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4);
}
.role-card .role-ic { grid-row: 1 / span 2; font-size: 1.5rem; }
.role-card small { color: var(--muted); }
.role-option input:checked + .role-card { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.role-option input:focus-visible + .role-card { outline: 3px solid var(--accent); outline-offset: 2px; }

@media (max-width: 480px) {
    .auth-card .row { grid-template-columns: 1fr; }
}

/* ---- Modern multi-column footer ---- */
.site-footer { padding: 0; }
.footer-grid {
    display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: var(--space-6);
    padding: var(--space-7) var(--space-4) var(--space-6);
}
.footer-brand { max-width: 300px; }
.footer-logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.2rem; color: var(--brand); }
.footer-logo:hover { text-decoration: none; }
.footer-logo-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-sm); background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; font-size: 1rem; }
.footer-tagline { margin-top: var(--space-3); color: var(--muted); font-size: .92rem; line-height: 1.6; }
.footer-col { display: flex; flex-direction: column; gap: var(--space-2); }
.footer-heading { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-bottom: var(--space-1); }
.footer-col a { color: var(--ink-2); font-size: .92rem; }
.footer-col a:hover { color: var(--brand); }
.footer-bottom {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap;
    padding: var(--space-4); border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem;
}
.footer-bottom p { margin: 0; color: var(--muted); }
.footer-built { color: var(--muted); }

@media (max-width: 720px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-5); }
    .footer-brand { grid-column: 1 / -1; max-width: none; }
}
@media (max-width: 420px) {
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { justify-content: center; text-align: center; }
}

/* ---- Modern header ---- */
.site-header-inner { display: flex; align-items: center; gap: var(--space-4); }
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius-sm); background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; font-weight: 800; font-size: 1rem; }
.main-nav { margin-left: auto; }
.nav-divider { width: 1px; height: 24px; background: var(--line); margin: 0 var(--space-1); }

/* Notifications bell */
.nav-icon-link { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-sm); font-size: 1.15rem; }
.nav-icon-link:hover { background: var(--bg-2); text-decoration: none; }
.nav-badge { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--radius-pill); background: #ef4444; color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; }

/* User dropdown */
.user-menu { position: relative; }
.user-menu-btn { display: inline-flex; align-items: center; gap: 8px; background: transparent; border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 5px 12px 5px 5px; cursor: pointer; color: var(--ink); font: inherit; max-width: 200px; }
.user-menu-btn:hover { background: var(--bg-2); border-color: var(--line-2); }
.user-avatar { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .82rem; background: linear-gradient(135deg, var(--brand), var(--accent)); }
.user-name { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-caret { flex: 0 0 auto; color: var(--muted); transition: transform .15s ease; }
.user-menu.open .user-caret { transform: rotate(180deg); }
.user-menu:hover .user-caret, .user-menu:focus-within .user-caret { transform: rotate(180deg); }
.user-menu-list {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: 6px; z-index: 70;
    opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.user-menu.open .user-menu-list { opacity: 1; visibility: visible; transform: translateY(0); }
/* No-JS / keyboard fallback: reveal on hover or when focus is inside the menu */
.user-menu:hover .user-menu-list,
.user-menu:focus-within .user-menu-list { opacity: 1; visibility: visible; transform: translateY(0); }
.user-menu-header { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-menu-header .user-avatar { width: 36px; height: 36px; font-size: 1rem; }
.user-menu-header-info { display: flex; flex-direction: column; min-width: 0; }
.user-menu-header-info strong { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-menu-header-info small { text-transform: capitalize; font-size: .78rem; }
.user-menu-sep { height: 1px; background: var(--line); margin: 4px 0; }
.user-menu-list a, .user-menu-list .linkbtn { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--ink-2); font-size: .92rem; }
.user-menu-list a:hover, .user-menu-list .linkbtn:hover { background: var(--bg-2); color: var(--ink); text-decoration: none; }
.user-menu-list .linkbtn { color: #dc2626; }

@media (max-width: 860px) {
    .main-nav { margin-left: 0; }
    .nav-divider { display: none; }
    /* In the mobile drawer, the user menu flattens into the list */
    .user-menu, .user-menu-list { position: static; }
    .user-menu-btn { display: none; }
    .user-menu-list { opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0; min-width: 0; }
    .nav-icon-link { width: auto; justify-content: flex-start; gap: 8px; padding: 12px 14px; }
}

/* ---- Account settings ---- */
.account-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-5); }
.account-id { display: flex; align-items: center; gap: var(--space-4); }
.account-id h1 { margin-bottom: 2px; }
.account-form { max-width: 760px; display: flex; flex-direction: column; gap: var(--space-4); }
.account-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); box-shadow: var(--shadow-sm); }
.account-panel h2 { font-size: 1.15rem; margin-bottom: var(--space-2); }
.account-panel > .muted { margin-bottom: var(--space-3); }
.field { margin-bottom: var(--space-3); }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.field input, .field textarea {
    width: 100%; padding: 11px 13px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink); font: inherit;
}
.field input:focus, .field textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-3); }

/* Skill toggle chips */
.skill-toggle-grid { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.skill-toggle { cursor: pointer; }
.skill-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.skill-toggle span {
    display: inline-block; padding: 7px 14px; border-radius: var(--radius-pill);
    border: 1px solid var(--line-2); color: var(--ink-2); font-size: .9rem; font-weight: 500;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.skill-toggle span:hover { border-color: var(--brand); }
.skill-toggle input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.skill-toggle input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.account-actions { position: sticky; bottom: var(--space-3); }
.account-actions .btn { min-width: 160px; }

/* ---- Notifications ---- */
.notif-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.notif { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.notif.is-unread { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); background: color-mix(in srgb, var(--brand-soft) 60%, var(--surface)); }
.notif-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4); color: var(--ink); }
a.notif-row:hover { text-decoration: none; background: var(--bg-2); }
.notif-icon { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 1.1rem; }
.n-blue { background: var(--info-bg); }
.n-indigo { background: var(--brand-soft); }
.n-teal { background: #ccfbf1; }
.n-amber { background: var(--warn-bg); }
.n-gray { background: var(--bg-2); }
.notif-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-msg { color: var(--ink); }
.notif.is-unread .notif-msg { font-weight: 600; }
.notif-time { font-size: .8rem; }
.notif-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }

@media (prefers-color-scheme: dark) { .n-teal { background: #134e4a; } }

/* ---- Orders list ---- */
.btn-sm { padding: 5px 12px; font-size: .85rem; }
.escrow-pill { display: inline-block; font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--bg-2); color: var(--ink-2); text-transform: capitalize; }
.escrow-held { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-bd); }
.escrow-released { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-bd); }
.escrow-refunded { background: var(--err-bg); color: var(--err-fg); border-color: var(--err-bd); }
.escrow-unfunded { background: var(--bg-2); color: var(--muted); }

/* ---- Messages inbox (conversation list) ---- */
.convo-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.convo { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); color: var(--ink); }
.convo:hover { border-color: var(--line-2); box-shadow: var(--shadow-md); text-decoration: none; }
.convo.is-unread { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); background: color-mix(in srgb, var(--brand-soft) 55%, var(--surface)); }
.convo-avatar { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.05rem; }
.convo-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.convo-top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.convo-name { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo.is-unread .convo-name { font-weight: 700; }
.convo-time { font-size: .78rem; flex: 0 0 auto; }
.convo-preview { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.convo.is-unread .convo-preview { color: var(--ink-2); }
.convo-badge { flex: 0 0 auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--brand); color: #fff; font-size: .72rem; font-weight: 700; display: grid; place-items: center; }

/* ---- Panel form extras (gig/job forms) ---- */
.field select {
    width: 100%; padding: 11px 13px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink); font: inherit;
}
.field select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.field-hint { display: block; color: var(--muted); font-size: .8rem; margin-top: 4px; }
.form-actions { display: flex; gap: var(--space-3); align-items: center; justify-content: flex-end; }
.form-actions.account-actions { position: static; }
