/* ===== CSS Variables ===== */
:root {
    --color-bg: #0a0a1a;
    --color-surface: #12122a;
    --color-surface-hover: #1a1a3a;
    --color-border: #2a2a4a;
    --color-text: #e0e0f0;
    --color-text-muted: #8888aa;
    --color-primary: #e94560;
    --color-highlight: #e94560;
    --color-accent: #0f3460;
    --color-success: #4ade80;
    --color-warning: #fbbf24;
    --color-error: #f87171;
    --color-meat: #e94560;
    --color-silicon: #3b82f6;
    --font-mono: 'Fira Code', 'JetBrains Mono', monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 8px;
    --radius-sm: 4px;
    --transition: 0.2s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: #ff6b81;
}

/* ===== Navigation ===== */
nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 2rem;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav .brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}

nav .nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
}

nav .nav-links a {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition);
    white-space: nowrap;
}

nav .nav-links a:hover,
nav .nav-links a.active {
    color: var(--color-text);
}

/* Network environment badge — shown in nav when on devnet */
.network-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    flex-shrink: 0;
}
.network-badge.devnet {
    background: #f59e0b22;
    color: #f59e0b;
    border: 1px solid #f59e0b55;
}
.network-badge:not(.devnet) {
    background: #10b98122;
    color: #10b981;
    border: 1px solid #10b98155;
}
.fee-network { margin-bottom: 0.75rem; }

/* Right-side nav actions group */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* ===== Layout ===== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

.page-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.page-header .page-title {
    margin-bottom: 0;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* ===== Radio Pill Filter ===== */
.type-filter {
    display: flex;
    gap: 0;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    overflow: hidden;
}

.radio-pill {
    cursor: pointer;
    margin: 0;
}

.radio-pill input[type="radio"] {
    display: none;
}

.radio-pill span {
    display: inline-block;
    padding: 0.35rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    background: transparent;
    transition: background var(--transition), color var(--transition);
}

.radio-pill input[type="radio"]:checked + span {
    background: var(--color-accent);
    color: var(--color-text);
}

.radio-pill input[type="radio"]:checked + span.meat {
    background: rgba(233, 69, 96, 0.2);
    color: var(--color-meat);
}

.radio-pill input[type="radio"]:checked + span.silicon {
    background: rgba(59, 130, 246, 0.2);
    color: var(--color-silicon);
}

.radio-pill span:hover {
    color: var(--color-text);
}

/* ===== Cards ===== */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: border-color var(--transition), transform var(--transition);
}

.card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-body {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.card-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1;
}

.badge-meat {
    background: rgba(233, 69, 96, 0.15);
    color: var(--color-meat);
    border: 1px solid rgba(233, 69, 96, 0.3);
}

.badge-silicon {
    background: rgba(59, 130, 246, 0.15);
    color: var(--color-silicon);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.sex-icon {
    margin-left: 0.2em;
    font-size: 0.8em;
    opacity: 0.5;
    vertical-align: baseline;
}

.badge-status {
    background: rgba(74, 222, 128, 0.15);
    color: var(--color-success);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.badge-status.open {
    background: rgba(74, 222, 128, 0.15);
    color: var(--color-success);
    border-color: rgba(74, 222, 128, 0.3);
}

.badge-status.assigned,
.badge-status.in_progress {
    background: rgba(251, 191, 36, 0.15);
    color: var(--color-warning);
    border-color: rgba(251, 191, 36, 0.3);
}

.badge-status.completed {
    background: rgba(59, 130, 246, 0.15);
    color: var(--color-silicon);
    border-color: rgba(59, 130, 246, 0.3);
}

.badge-status.cancelled,
.badge-status.disputed {
    background: rgba(248, 113, 113, 0.15);
    color: var(--color-error);
    border-color: rgba(248, 113, 113, 0.3);
}

/* ===== Skill Tags ===== */
.skill-tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: var(--color-accent);
    color: var(--color-text);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

/* ===== Search Bar ===== */
.search-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.search-bar input,
.search-bar select {
    padding: 0.6rem 0.9rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition);
}

.search-bar input:focus,
.search-bar select:focus {
    border-color: var(--color-primary);
}

.search-bar input {
    flex: 1;
    min-width: 200px;
}

.search-bar select {
    min-width: 140px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

.btn a {
    color: inherit;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: #ff6b81;
}

.btn-secondary {
    background: var(--color-accent);
    color: var(--color-text);
}

.btn-secondary:hover {
    background: #1a4a80;
}

.btn-load-more {
    display: block;
    margin: 1.5rem auto 0;
    padding: 0.6rem 2rem;
}

/* ===== Loading & Error States ===== */
.loading {
    display: flex;
    justify-content: center;
    padding: 3rem;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 1.2rem;
    height: 1.2rem;
    margin-left: 0.6rem;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error {
    padding: 1rem 1.25rem;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    border-radius: var(--radius);
    color: var(--color-error);
    font-size: 0.9rem;
}

/* ===== Profile Page ===== */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.profile-name {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.profile-headline {
    color: var(--color-text-muted);
    font-size: 1.05rem;
    margin: 0.25rem 0 0;
}

.profile-badges {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.badge-available {
    background: rgba(74, 222, 128, 0.15);
    color: var(--color-success);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.badge-unavailable {
    background: rgba(156, 163, 175, 0.15);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

.profile-bio {
    line-height: 1.7;
    white-space: pre-wrap;
}

.profile-section {
    margin-bottom: 1.5rem;
}

.profile-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.profile-detail {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.5rem 1rem;
    font-size: 0.9rem;
}

.profile-detail dt {
    color: var(--color-text-muted);
}

.profile-detail a {
    color: var(--color-primary);
    text-decoration: none;
}

.profile-detail a:hover {
    text-decoration: underline;
}

.profile-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.profile-socials {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.social-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.social-network {
    font-weight: 600;
    min-width: 80px;
    color: var(--color-text-muted);
}

.social-item a {
    color: var(--color-primary);
    text-decoration: none;
}

.social-item a:hover {
    text-decoration: underline;
}

.profile-wallets {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ===== Task Detail ===== */
.task-header {
    margin-bottom: 1rem;
}

.task-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.25;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.task-meta .budget {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-success);
}

.task-meta-label {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.task-meta-deadline {
    color: var(--color-warning);
}

/* Poster info row beneath the title */
.task-poster-section {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.task-poster-link a {
    color: var(--color-primary);
    font-weight: 500;
    text-decoration: none;
}

.task-poster-link a:hover {
    text-decoration: underline;
}

.task-description {
    line-height: 1.75;
    white-space: pre-wrap;
    color: var(--color-text);
    font-size: 0.975rem;
}

.task-section {
    margin-bottom: 1.75rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--color-border);
}

.task-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.task-section h3 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

/* Section item count badge (e.g. "Applications (3)") */
.section-count {
    font-weight: 400;
    color: var(--color-text-muted);
}

/* Skills row */
.task-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* Payment options */
.task-payment-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.task-payment-option {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.payment-currency {
    font-weight: 600;
    color: var(--color-success);
    font-family: var(--font-mono);
}

/* Action buttons cluster */
.action-buttons {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* Delivery form */
.deliver-form {
    margin-top: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.9rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 0.9rem;
    font-family: var(--font-sans);
    resize: vertical;
    transition: border-color var(--transition);
}

.form-control:focus {
    border-color: var(--color-primary);
    outline: none;
}

/* Apply for task section */
.task-apply-section {
    background: rgba(15, 52, 96, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.task-apply-hint {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.apply-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.apply-rate-row {
    max-width: 280px;
}

.apply-rate-input {
    /* inherits .form-control styles from .form-group rules */
}

/* "Already applied" notice */
.task-applied-notice {
    padding: 0.85rem 1.1rem;
    background: rgba(74, 222, 128, 0.08);
    border: 1px solid rgba(74, 222, 128, 0.2);
    border-radius: var(--radius-sm);
    color: var(--color-success);
    font-size: 0.9rem;
}

/* Application cards (poster review panel) */
.application-card {
    margin-bottom: 0.75rem;
}

.application-card:last-child {
    margin-bottom: 0;
}

.application-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.application-applicant a {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-primary);
    text-decoration: none;
}

.application-applicant a:hover {
    text-decoration: underline;
}

.application-rate {
    font-weight: 700;
    color: var(--color-success);
    font-size: 0.95rem;
}

.application-proposal {
    color: var(--color-text);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    white-space: pre-wrap;
}

.applicant-wallets {
    margin: 0.5rem 0 0.75rem;
}

.applicant-wallets-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.applicant-wallet-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.82rem;
}

.wallet-addr {
    font-family: var(--font-mono);
    color: var(--color-text-muted);
    word-break: break-all;
}

.application-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

/* btn-warning */
.btn-warning {
    background: rgba(251, 191, 36, 0.15);
    color: var(--color-warning);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.btn-warning:hover {
    background: rgba(251, 191, 36, 0.28);
}

/* Assignment cards */
.assignment-card {
    margin-bottom: 0.75rem;
}

.assignment-card:last-child {
    margin-bottom: 0;
}

.assignment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
}

.assignment-header a {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-primary);
    text-decoration: none;
}

.assignment-header a:hover {
    text-decoration: underline;
}

.assignment-meta {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 0.35rem;
}

.delivery-notes {
    margin-top: 0.5rem;
    padding: 0.65rem 0.9rem;
    background: var(--color-bg);
    border-left: 3px solid var(--color-primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.875rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Alert messages (action feedback) */
.alert {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: var(--color-success);
}

.alert-error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: var(--color-error);
}

/* Responsive task detail */
@media (max-width: 640px) {
    .task-title {
        font-size: 1.5rem;
    }

    .task-apply-section {
        padding: 1rem;
    }

    .apply-rate-row {
        max-width: 100%;
    }
}

/* ===== Home Page ===== */
.hero {
    text-align: center;
    padding: 4rem 1rem;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

.hero h1 .highlight {
    color: var(--color-primary);
}

.hero p {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* ===== Platform Stats ===== */
.stats-section {
    max-width: 900px;
    margin: 3rem auto 0;
    padding: 0 1rem;
}

.stats-heading {
    text-align: center;
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--color-text-muted);
    font-weight: 500;
    letter-spacing: 0.03em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.stat-card.stat-accent {
    border-color: var(--color-primary);
    background: rgba(229, 62, 62, 0.05);
}

.stat-card.stat-success {
    border-color: var(--color-success);
    background: rgba(74, 222, 128, 0.05);
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
    font-family: var(--font-mono);
}

.stat-accent .stat-value {
    color: var(--color-primary);
}

.stat-success .stat-value {
    color: var(--color-success);
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.4rem;
    font-weight: 500;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

/* ===== Profile Edit Form ===== */
.profile-edit {
    max-width: 700px;
    margin: 0 auto;
}

.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.form-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

/* Section header row: title left, floppy-disk save button right */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}
.section-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
    padding: 0;
    border: none;
}
.btn-save-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 4px 6px;
    cursor: pointer;
    color: var(--color-primary);
    transition: border-color 0.15s, background 0.15s;
    line-height: 1;
}
.btn-save-icon:hover {
    border-color: var(--color-primary);
    background: rgba(233, 69, 96, 0.08);
}
.btn-save-icon:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.9rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 0.9rem;
    font-family: var(--font-sans);
    transition: border-color var(--transition);
}

.form-group select,
.search-bar select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23999' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--color-primary);
    outline: none;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.char-counter {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-align: right;
    margin-top: 0.25rem;
}

.char-counter.warn {
    color: var(--color-warning);
}

.char-counter.over {
    color: var(--color-error);
}

.field-error {
    font-size: 0.8rem;
    color: var(--color-error);
    margin-top: 0.25rem;
}

.radio-group {
    display: flex;
    gap: 1.25rem;
    padding-top: 0.35rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--color-text);
}

.radio-label input[type="radio"] {
    accent-color: var(--color-primary);
    cursor: pointer;
}

/* Toggle Switch */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle .slider {
    position: absolute;
    inset: 0;
    background: var(--color-border);
    border-radius: 999px;
    cursor: pointer;
    transition: background var(--transition);
}

.toggle .slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--color-text);
    border-radius: 50%;
    transition: transform var(--transition);
}

.toggle input:checked + .slider {
    background: var(--color-success);
}

.toggle input:checked + .slider::before {
    transform: translateX(22px);
}

.toggle-label {
    font-size: 0.9rem;
    color: var(--color-text);
}

/* Skill Tag Input */
.skill-tag-input {
    position: relative;
}

.skill-tag-input input {
    width: 100%;
    padding: 0.6rem 0.9rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 0.9rem;
}

.skill-tag-input input:focus {
    border-color: var(--color-primary);
    outline: none;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.skill-tag.removable {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    background: var(--color-accent);
    color: var(--color-text);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

.skill-remove {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0 0.15rem;
    line-height: 1;
}

.skill-remove:hover {
    color: var(--color-error);
}

.skill-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    margin-top: 2px;
}

.skill-suggestion {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--color-text);
}

.skill-suggestion:hover {
    background: var(--color-surface-hover);
}

/* ===== Connect Wallet Page ===== */
.connect-wallet {
    max-width: 500px;
    margin: 2rem auto;
    text-align: center;
}

.wallet-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 2rem 0;
}

.wallet-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color var(--transition), transform var(--transition);
}

.wallet-btn:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.wallet-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.wallet-btn.metamask {
    border-color: #f6851b33;
}

.wallet-btn.metamask:hover {
    border-color: #f6851b;
}

.wallet-btn.phantom {
    border-color: #ab9ff233;
}

.wallet-btn.phantom:hover {
    border-color: #ab9ff2;
}

.wallet-step {
    padding: 1.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-top: 1.5rem;
}

/* ===== Nav Auth ===== */
.btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
}

.btn a {
    color: inherit;
    text-decoration: none;
}

.nav-cta a {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background: var(--color-primary);
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    border-radius: 6px;
    text-decoration: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.3);
}

.nav-cta a:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(229, 62, 62, 0.45);
    background: linear-gradient(135deg, #ff6b6b, var(--color-primary));
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-user-link {
    display: flex;
    align-items: center;
}

.nav-user-link a {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.user-icon {
    flex-shrink: 0;
}

/* ===== Success/Status Messages ===== */
.success {
    padding: 1rem 1.25rem;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: var(--radius);
    color: var(--color-success);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* ===== Wallet Display ===== */
.wallet-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wallet-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.wallet-item .chain-badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    background: var(--color-accent);
    color: var(--color-text);
    min-width: 5.5rem;
    text-align: center;
    flex-shrink: 0;
}

.wallet-item .address {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-decoration: none;
    min-width: 8rem;
}

.wallet-item .wallet-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}

a.address:hover {
    text-decoration: underline;
    color: var(--color-primary);
}

.copy-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 2px;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.copy-btn:hover {
    opacity: 1;
    color: var(--color-primary);
}

.primary-prompt {
    background: var(--color-surface);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.primary-prompt p {
    margin: 0 0 0.5rem 0;
}

.btn-xs {
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
}

.wallet-item .primary-badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    background: var(--color-primary);
    color: #fff;
    border-radius: 9999px;
    letter-spacing: 0.04em;
}

.wallet-item .session-badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    background: rgba(100, 100, 255, 0.15);
    color: #8888ff;
    border-radius: 9999px;
    letter-spacing: 0.04em;
}

.btn-danger {
    background: rgba(220, 50, 50, 0.15);
    color: #e94560;
    border: 1px solid rgba(220, 50, 50, 0.3);
}

.btn-danger:hover {
    background: rgba(220, 50, 50, 0.3);
}

/* ===== Toast Notifications ===== */
.toast {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    animation: toast-slide-in 0.3s ease-out;
    max-width: min(90vw, 500px);
}

.toast-success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    backdrop-filter: blur(12px);
}

.toast-error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    backdrop-filter: blur(12px);
}

.toast-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
    flex-shrink: 0;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes toast-slide-in {
    from {
        transform: translateX(-50%) translateY(-1rem);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* ===== Terms of Service Page ===== */
.terms-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

.terms-content {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 3rem;
}

.terms-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.terms-content .last-updated {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.terms-content section {
    margin-bottom: 2rem;
}

.terms-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.terms-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.terms-content p {
    line-height: 1.8;
    margin-bottom: 1rem;
    color: var(--color-text-muted);
}

.terms-content ul {
    list-style-type: disc;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-text-muted);
}

.terms-content li {
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

.terms-content a {
    color: var(--color-primary);
    text-decoration: underline;
}

.terms-content a:hover {
    color: #ff6b81;
}

.terms-content strong {
    color: var(--color-text);
    font-weight: 600;
}

.terms-content .disclaimer-box {
    background: rgba(233, 69, 96, 0.1);
    border: 1px solid rgba(233, 69, 96, 0.3);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.terms-content .disclaimer-box p {
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

.terms-content .disclaimer-box ul {
    margin-top: 0.5rem;
}

.terms-content .acknowledgment {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    margin-top: 2rem;
}

.terms-content .acknowledgment p {
    color: var(--color-text);
}

.terms-content .terms-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.terms-content .terms-footer p {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.terms-content .full-terms-link {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    text-align: center;
}

.terms-content .full-terms-link p {
    margin: 0;
    font-size: 0.95rem;
}

/* ===== Footer ===== */
.footer {
    margin-top: 4rem;
    padding: 3rem 2rem 1.5rem;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-section p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color var(--transition);
}

.footer-section a:hover {
    color: var(--color-primary);
}

.footer-bottom {
    max-width: 1100px;
    margin: 0 auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin: 0;
}

/* ===== Task Stage Widget ===== */

.task-stages-wrapper {
    margin: 1.5rem 0;
}

/* Horizontal stepper row */
.task-stages {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

/* Individual step: circle + label stacked */
.task-stage-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    min-width: 56px;
}

/* Circle */
.task-stage-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: background var(--transition), box-shadow var(--transition);
}

.task-stage-circle.past {
    background: var(--color-primary);
}

.task-stage-circle.current {
    background: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(233, 69, 96, 0.25);
}

/* Pulsing ring for "draft_review" in progress */
.task-stage-circle.current.pulsing {
    animation: stage-pulse 1.5s ease-in-out infinite;
}

@keyframes stage-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(233, 69, 96, 0.25); }
    50%       { box-shadow: 0 0 0 8px rgba(233, 69, 96, 0.10); }
}

.task-stage-circle.future {
    background: transparent;
    border: 2px solid var(--color-border);
}

.task-stage-circle.dimmed {
    opacity: 0.35;
}

/* Connector line */
.task-stage-line {
    flex: 1;
    height: 2px;
    background: var(--color-border);
    min-width: 16px;
    margin-bottom: 22px; /* align with circle center */
    transition: background var(--transition);
}

.task-stage-line.filled {
    background: var(--color-primary);
}

.task-stage-line.dimmed {
    opacity: 0.35;
}

/* Label below circle */
.task-stage-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    white-space: nowrap;
    text-align: center;
}

.task-stage-label.active {
    color: var(--color-text);
}

.task-stage-label.dimmed {
    opacity: 0.35;
}

/* Status badges below the stepper */
.stage-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-top: 0.5rem;
}

.stage-badge-rejected {
    background: rgba(248, 113, 113, 0.15);
    color: var(--color-error);
    border: 1px solid rgba(248, 113, 113, 0.35);
}

.stage-badge-cancelled {
    background: rgba(136, 136, 170, 0.15);
    color: var(--color-text-muted);
    border: 1px solid rgba(136, 136, 170, 0.3);
}

/* ===== Task Creation Page ===== */

.task-create-page {
    max-width: 720px;
}

.task-create-form {
    margin-top: 1.5rem;
}

.task-create-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.task-create-saved-note {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.task-create-saved-note code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-primary);
}

/* Reviewing / polling state */
.task-create-reviewing {
    margin-top: 1.5rem;
}

.task-create-review-note {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* Approved / ready-to-fund state */
.task-create-approved {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--color-surface);
    border: 1px solid rgba(74, 222, 128, 0.35);
    border-radius: var(--radius);
}

.task-create-approved-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.task-create-approved-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.task-create-fund-notice {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

/* Rejected state */
.task-create-rejected {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--color-surface);
    border: 1px solid rgba(248, 113, 113, 0.35);
    border-radius: var(--radius);
}

.task-create-rejected-header {
    margin-bottom: 0.75rem;
}

.task-create-feedback {
    margin: 0.75rem 0 1rem;
    padding: 0.75rem 1rem;
    background: rgba(248, 113, 113, 0.08);
    border-left: 3px solid var(--color-error);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    font-size: 0.9rem;
    color: var(--color-text);
}

/* "+ Post Task" — always-visible primary CTA button in the nav */
.nav-post-task a {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 1rem;
    background: var(--color-primary);
    color: #fff !important;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    transition: opacity 0.15s;
    text-decoration: none;
}

.nav-post-task a:hover {
    opacity: 0.85;
    color: #fff !important;
}

/* ===== Responsive ===== */

/* ── 768px — tablet / large phone landscape ── */
@media (max-width: 768px) {
    /* Nav: two-row layout
       Row 1: brand (left) | nav-actions (right)
       Row 2: nav-links — horizontal scrollable strip */
    nav {
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
        gap: 0;
    }

    nav .brand {
        order: 1;
        flex-shrink: 0;
    }

    .nav-actions {
        order: 2;
        margin-left: auto;
        flex-shrink: 0;
        gap: 0.5rem;
    }

    nav .nav-links {
        order: 3;
        width: 100%;
        flex: none;
        overflow-x: auto;
        padding: 0.5rem 0 0.25rem;
        gap: 1.25rem;
        /* Visually hide the scrollbar while keeping it functional */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    nav .nav-links::-webkit-scrollbar {
        display: none;
    }

    /* Shrink nav CTA text slightly so it fits alongside brand */
    .nav-post-task a {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }

    .nav-cta a {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }

    .btn-sm {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }

    /* Page header: wrap so buttons don't overflow off-screen */
    .page-header {
        gap: 0.75rem;
    }

    /* Hero */
    .hero h1 {
        font-size: 2.25rem;
    }

    /* Wallet buttons: full-width on medium screens */
    .wallet-btn {
        width: 100%;
    }

    /* Task stage widget — slightly tighter on tablet */
    .task-stage-step {
        min-width: 44px;
    }

    .task-stage-circle {
        width: 28px;
        height: 28px;
    }

    .task-stage-label {
        font-size: 0.58rem;
    }

    .task-stage-line {
        min-width: 10px;
        margin-bottom: 18px;
    }
}

/* ── 640px — small phone portrait ── */
@media (max-width: 640px) {
    nav {
        padding: 0.75rem 1rem;
        gap: 0;
    }

    .container {
        padding: 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    /* Page header: stack title and actions vertically */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Touch targets: all buttons at least 44px tall */
    .btn {
        min-height: 44px;
    }

    .btn-sm {
        min-height: 36px; /* secondary actions can be slightly smaller */
    }

    /* Prevent iOS from zooming on input focus (font-size must be >= 16px) */
    .form-group input[type="text"],
    .form-group input[type="number"],
    .form-group input[type="url"],
    .form-group input[type="date"],
    .form-group select,
    .form-group textarea,
    .search-bar input,
    .search-bar select,
    .skill-tag-input input {
        font-size: 1rem; /* 16px — prevents iOS auto-zoom on focus */
    }

    /* Card grid: single column */
    .card-grid {
        grid-template-columns: 1fr;
        /* Also ensure minmax doesn't blow past viewport */
        min-width: 0;
    }

    /* Profile detail: single column */
    .profile-detail {
        grid-template-columns: 1fr;
    }

    /* Profile header: stack on narrow phones */
    .profile-header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Form rows: stack to single column */
    .form-row, .form-row-3 {
        grid-template-columns: 1fr;
    }

    /* Form section: tighten padding */
    .form-section {
        padding: 1rem;
    }

    /* Section header (title + floppy disk): keep on one line, no flex-shrink issues */
    .section-header {
        gap: 0.5rem;
        flex-wrap: nowrap;
    }

    .section-header h2 {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Task stage widget — compact circles at 640px */
    .task-stage-step {
        min-width: 36px;
        gap: 0.3rem;
    }

    .task-stage-circle {
        width: 24px;
        height: 24px;
    }

    .task-stage-label {
        font-size: 0.55rem;
        letter-spacing: 0.04em;
    }

    .task-stage-line {
        min-width: 8px;
        margin-bottom: 14px;
    }

    /* Task creation page: full width, reduce max-width constraint */
    .task-create-page {
        max-width: 100%;
    }

    /* Task create actions: stack buttons */
    .task-create-actions {
        flex-direction: column;
    }

    .task-create-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Approved/rejected panels: tighten padding */
    .task-create-approved,
    .task-create-rejected {
        padding: 1rem;
    }

    .task-create-approved-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Connect wallet: full-width buttons */
    .wallet-btn {
        width: 100%;
    }

    .connect-wallet {
        margin: 1rem auto;
        padding: 0 0.5rem;
    }

    /* Wallet item: allow address to wrap on very narrow screens */
    .wallet-item {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .wallet-item .address {
        min-width: 0;
        word-break: break-all;
        font-size: 0.75rem;
    }

    .wallet-item .wallet-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }

    /* Search bar: stack inputs */
    .search-bar {
        flex-direction: column;
        gap: 0.5rem;
    }

    .search-bar input {
        min-width: 0;
        width: 100%;
    }

    .search-bar select {
        min-width: 0;
        width: 100%;
    }

    /* Hero links: stack on very small phones */
    .hero-links {
        flex-direction: column;
        align-items: center;
    }

    /* Terms */
    .terms-content {
        padding: 1.5rem;
    }

    .terms-content h1 {
        font-size: 2rem;
    }

    .terms-content h2 {
        font-size: 1.3rem;
    }

    /* Footer */
    .footer {
        padding: 2rem 1rem 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ── 480px — very narrow phones ── */
@media (max-width: 480px) {
    /* Task stage widget: compact circles-only row — hide text labels entirely.
       The colored circles and connecting lines still convey progress status
       without needing text that would overflow at this width. */
    .task-stage-label {
        display: none;
    }

    .task-stages {
        /* Keep flex but let it scroll horizontally — circles fill the row */
        overflow-x: auto;
        padding-bottom: 0.25rem;
    }

    .task-stage-step {
        min-width: 24px;
        gap: 0;
    }

    .task-stage-circle {
        width: 20px;
        height: 20px;
    }

    .task-stage-line {
        min-width: 6px;
        margin-bottom: 10px;
    }

    /* Nav: condense brand font */
    nav .brand {
        font-size: 1.05rem;
    }

    /* Container: tightest padding */
    .container {
        padding: 0.75rem;
    }

    /* Page title: reduce size */
    .page-title {
        font-size: 1.4rem;
    }

    /* Stat cards: reduce value font size */
    .stat-value {
        font-size: 1.4rem;
    }

    /* Profile name: reduce size */
    .profile-name {
        font-size: 1.5rem;
    }
}

/* ===== Fee Breakdown Panel (task funding) ===== */
.fee-breakdown {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    max-width: 480px;
}
.fee-breakdown h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.fee-rows { display: flex; flex-direction: column; gap: 0.6rem; }
.fee-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}
.fee-row.fee-total {
    border-top: 1px solid var(--color-border);
    padding-top: 0.6rem;
    margin-top: 0.3rem;
    font-weight: 700;
    font-size: 1rem;
}
.fee-label { color: var(--color-text-muted); display: flex; align-items: center; gap: 0.35rem; }
.fee-amount { font-weight: 500; white-space: nowrap; }
.fee-actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; justify-content: flex-end; }

/* [?] tooltip icon */
.fee-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.65rem;
    font-weight: 700;
    cursor: help;
    position: relative;
    line-height: 1;
    flex-shrink: 0;
}
.fee-help::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.4;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    white-space: normal;
    width: 220px;
    text-align: left;
    pointer-events: none;
    display: none;
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.fee-help:hover::after { display: block; }

/* Task funded success state */
.task-create-funded { text-align: center; padding: 2rem 0; }
.task-create-funded h2 { color: var(--color-success, #10b981); margin-bottom: 0.5rem; }

/* ===== Social Account Verification (profile edit + public profile) ===== */

/* Verified badge — green, used in both edit page and public profile */
.social-verified {
    color: #10b981;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Unverified label — muted, shown on public profile and before verification */
.social-unverified {
    color: var(--color-text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
}

/* Inline row wrapping the link/handle and the badge together */
.social-link-row {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Verify → button in profile edit — compact */
.btn-verify {
    font-size: 0.75rem;
    padding: 2px 8px;
    line-height: 1.4;
}

/* Profile edit: each social network row (input + badge column) */
.social-field-row {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.social-input-group {
    flex: 1 1 220px;
    min-width: 0;
    margin-bottom: 0 !important;
}

/* Column that holds the badge / verify button */
.social-badge-col {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.25rem;
    min-width: 120px;
    flex-shrink: 0;
}

/* Small descriptive text beneath the section heading */
.form-hint {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* Verification panel — the code + instructions box */
.verify-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.verify-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Instructions text inside the panel */
.verify-instructions {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Row containing the code input + Copy button */
.verify-code-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Monospace read-only box showing the verification code */
.verify-code-box {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
    color: var(--color-text);
    flex: 1 1 auto;
    min-width: 0;
    cursor: text;
    user-select: all;
}

/* "Check Verification" button */
.verify-check-btn {
    align-self: flex-start;
}

/* Success / failure message beneath the check button */
.verify-msg {
    font-size: 0.875rem;
    margin: 0;
}

.verify-msg-ok {
    color: #10b981;
}

.verify-msg-fail {
    color: var(--color-error);
}

/* Expiry note at the bottom of the panel */
.verify-expiry {
    color: var(--color-text-muted);
    font-size: 0.75rem;
    margin: 0;
}

/* Inline text button (close panel link) */
.btn-link {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    transition: color var(--transition);
}
.btn-link:hover {
    color: var(--color-text);
}

/* Reputation score in the public profile detail grid */
.reputation-score {
    color: var(--color-warning);
    font-weight: 600;
}
.tx-sig { font-size: 0.75rem; color: var(--color-text-muted); word-break: break-all; margin: 1rem 0; }

/* ===== Modal Overlay (reset confirmation, etc.) ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    animation: modal-fade-in 0.15s ease-out;
}

@keyframes modal-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.modal-text {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* ===== Unread Badge ===== */
.unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    margin-left: 4px;
    vertical-align: middle;
}

.nav-inbox-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

/* ===== Task Messaging ===== */
.task-messages-section {
    margin-top: 1.5rem;
}

.msg-participants {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.msg-participant-btn {
    font-size: 0.8rem;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msg-thread {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 0.75rem;
}

.msg-thread-header {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

.msg-list {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.msg-bubble {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    max-width: 80%;
    word-wrap: break-word;
}

.msg-mine {
    background: var(--color-accent);
    align-self: flex-end;
}

.msg-theirs {
    background: var(--color-surface-hover);
    align-self: flex-start;
}

.msg-sender {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 2px;
}

.msg-content {
    font-size: 0.9rem;
    line-height: 1.4;
}

.msg-time {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin-top: 2px;
    text-align: right;
}

.msg-compose {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    margin-top: 0.75rem;
}

.msg-compose textarea {
    flex: 1;
    resize: vertical;
}

.msg-compose .btn {
    white-space: nowrap;
}

/* ===== Inbox Page ===== */
.inbox-page {
    max-width: 800px;
    margin: 0 auto;
}

.inbox-page h2 {
    margin-bottom: 1.5rem;
}

.inbox-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
}

.inbox-threads {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.inbox-thread-link {
    text-decoration: none;
    color: inherit;
}

.inbox-thread {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem;
    transition: background var(--transition);
}

.inbox-thread:hover {
    background: var(--color-surface-hover);
}

.inbox-thread-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.inbox-thread-title {
    font-weight: 600;
    font-size: 1rem;
    flex: 1;
}

.inbox-thread-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

.inbox-thread-preview {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== Commissions Table ===== */
.commissions-table-wrap {
    overflow-x: auto;
    margin-top: 1rem;
}

.commissions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.commissions-table thead th {
    text-align: left;
    padding: 0.75rem 0.5rem;
    border-bottom: 2px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.commissions-table tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition);
}

.commissions-table tbody tr:hover {
    background: var(--color-surface-hover);
}

.commissions-table td {
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
}

.comm-title-cell {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comm-title-cell a {
    font-weight: 500;
}

.comm-budget {
    font-weight: 600;
    white-space: nowrap;
}

.comm-fees {
    white-space: nowrap;
    color: var(--color-text-muted);
    cursor: help;
}

.comm-currency {
    white-space: nowrap;
}

.comm-skills {
    max-width: 200px;
}

.skill-tag-sm {
    font-size: 0.7rem;
    padding: 1px 6px;
}

.comm-deadline {
    white-space: nowrap;
    color: var(--color-text-muted);
}

.comm-tx {
    white-space: nowrap;
}

.tx-link {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-primary);
}

.tx-link:hover {
    text-decoration: underline;
}

/* Responsive: stack table on small screens */
@media (max-width: 768px) {
    .commissions-table thead { display: none; }
    .commissions-table tbody tr {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem 1rem;
        padding: 0.75rem 0;
    }
    .commissions-table td {
        padding: 0.15rem 0;
    }
    .comm-title-cell {
        width: 100%;
        max-width: none;
        font-size: 1rem;
    }
}
