:root {
    --ink: #14121F;
    --ink-soft: #211D33;
    --porcelain: #F7F4EF;
    --porcelain-dim: #ECE7DD;
    --amber: #FF8A3D;
    --amber-deep: #E86A1E;
    --mint: #2BD4A6;
    --violet: #6C5CE0;
    --pink: #E85D75;
    --line: rgba(20, 18, 31, 0.10);
    --shadow-soft: 0 20px 60px -20px rgba(20, 18, 31, 0.25);
    --radius-lg: 28px;
    --radius-sm: 12px;
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --ease: cubic-bezier(.22, .9, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--porcelain);
    color: var(--ink);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }

.wrap { max-width: 920px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 560px; margin: 0 auto; padding: 0 24px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.96rem;
    border: 1px solid transparent;
    transition: transform .3s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
    background: var(--amber);
    color: #fff;
    box-shadow: 0 10px 30px -10px rgba(255, 138, 61, 0.55);
}
.btn-primary:disabled { opacity: .65; cursor: not-allowed; transform: none; }
.btn-ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--ink);
}
.btn-sm { padding: 10px 18px; font-size: 0.9rem; }

.nav { padding: 14px 0; }
.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: rgba(247, 244, 239, 0.72);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(20, 18, 31, 0.08);
    border-radius: 100px;
    padding: 10px 10px 10px 22px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 700;
}
.logo-mark {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--amber), #E85D75);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
}

.step-shell, .profile-shell, .auth-shell { padding: 20px 0 60px; }
.page-hero { margin: 18px 0 28px; }
.page-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    letter-spacing: -0.02em;
    margin: 0 0 8px;
}
.page-hero p { margin: 0; color: rgba(20, 18, 31, 0.65); max-width: 52ch; }

.step-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
.step-pill {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 100px;
    background: var(--porcelain-dim);
    color: rgba(20, 18, 31, 0.55);
}
.step-pill.active {
    background: var(--ink);
    color: var(--porcelain);
}
.step-pill.done {
    background: rgba(43, 212, 166, 0.18);
    color: #0d7a5c;
}

.signup-form, .auth-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-soft);
}

.form-section { margin-bottom: 28px; }
.form-section:last-of-type { margin-bottom: 0; }
.form-section h2 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    margin: 0 0 6px;
}
.form-section > p {
    margin: 0 0 16px;
    color: rgba(20, 18, 31, 0.6);
    font-size: 0.92rem;
}

.field-grid {
    display: grid;
    gap: 16px;
}
.field-grid.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) {
    .field-grid.two { grid-template-columns: 1fr; }
}

.field label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
}
.field .req { color: var(--amber-deep); }
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="tel"],
.field input[type="date"],
.field input[type="number"],
.field input[type="url"],
.field select,
.field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--porcelain);
    font-size: 0.95rem;
    color: var(--ink);
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: 2px solid rgba(255, 138, 61, 0.35);
    border-color: var(--amber);
}
.hint {
    margin: 6px 0 0;
    font-size: 0.82rem;
    color: rgba(20, 18, 31, 0.5);
}

.check-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.check-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 100px;
    border: 1px solid var(--line);
    background: var(--porcelain);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}
.check-pill:has(input:checked) {
    background: rgba(255, 138, 61, 0.12);
    border-color: var(--amber);
    color: var(--amber-deep);
}
.check-pill input { accent-color: var(--amber); }

.radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.radio-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 100px;
    border: 1px solid var(--line);
    background: var(--porcelain);
    font-weight: 500;
    cursor: pointer;
}
.radio-pill:has(input:checked) {
    border-color: var(--amber);
    background: rgba(255, 138, 61, 0.12);
}
.radio-pill input { accent-color: var(--amber); }

.declare-list {
    display: grid;
    gap: 12px;
}
.declare-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--porcelain);
    font-size: 0.9rem;
}
.declare-item input { margin-top: 3px; accent-color: var(--amber); }

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.form-message {
    display: none;
    margin-bottom: 18px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 500;
}
.form-message.show { display: block; }
.form-message.error {
    background: rgba(232, 93, 117, 0.12);
    color: #a12d45;
    border: 1px solid rgba(232, 93, 117, 0.25);
}
.form-message.success {
    background: rgba(43, 212, 166, 0.14);
    color: #0d7a5c;
    border: 1px solid rgba(43, 212, 166, 0.3);
}

.upload-block {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px dashed var(--line);
    border-radius: var(--radius-sm);
    background: var(--porcelain);
}
.upload-block.ok { border-color: var(--mint); background: rgba(43, 212, 166, 0.08); }
.upload-status { font-size: 0.85rem; color: rgba(20, 18, 31, 0.55); }
.upload-status.has-file { color: #0d7a5c; font-weight: 600; }
.upload-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.upload-row input[type="file"] { max-width: 100%; }

.admin-note {
    font-size: 0.85rem;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: rgba(20, 18, 31, 0.05);
    color: rgba(20, 18, 31, 0.7);
    margin-bottom: 14px;
}

/* Profile hub */
.step-cards {
    display: grid;
    gap: 12px;
}
.step-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    transition: border-color .2s, box-shadow .2s;
}
.step-card:hover {
    border-color: rgba(255, 138, 61, 0.4);
    box-shadow: var(--shadow-soft);
}
.step-card h3 {
    margin: 0 0 4px;
    font-family: var(--font-display);
    font-size: 1.05rem;
}
.step-card p { margin: 0; font-size: 0.88rem; color: rgba(20, 18, 31, 0.55); }
.badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
    white-space: nowrap;
}
.badge.done { background: rgba(43, 212, 166, 0.18); color: #0d7a5c; }
.badge.todo { background: var(--porcelain-dim); color: rgba(20, 18, 31, 0.55); }

.loading-card, .error-card {
    padding: 28px;
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    text-align: center;
}
.error-card { color: #a12d45; }
.progress-bar {
    height: 8px;
    background: var(--porcelain-dim);
    border-radius: 100px;
    overflow: hidden;
    margin: 18px 0 28px;
}
.progress-bar > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--amber), var(--mint));
    border-radius: 100px;
    transition: width .4s var(--ease);
}

.footer {
    padding: 24px 0 40px;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(20, 18, 31, 0.45);
}

.auth-switch {
    margin-top: 18px;
    text-align: center;
    font-size: 0.92rem;
    color: rgba(20, 18, 31, 0.65);
}
.auth-switch a { color: var(--amber-deep); font-weight: 600; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 9999;
    background: var(--ink); color: var(--porcelain);
    padding: 14px 22px; border-radius: 0 0 10px 0; font-weight: 600;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 4px; }

.wrap-wide { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.page-shell { padding: 12px 0 72px; }

.page-nav-links {
    display: none;
    align-items: center;
    gap: 22px;
    font-size: 0.92rem;
    font-weight: 500;
}
.page-nav-links a { opacity: .78; }
.page-nav-links a:hover,
.page-nav-links a.is-active { opacity: 1; }
.nav-badge {
    display: inline-flex;
    min-width: 18px;
    height: 18px;
    margin-left: 6px;
    padding: 0 5px;
    border-radius: 100px;
    background: var(--amber);
    color: var(--ink);
    font-size: 0.7rem;
    font-weight: 700;
    align-items: center;
    justify-content: center;
}
@media (min-width: 760px) {
    .page-nav-links { display: flex; }
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    justify-content: center;
    margin-bottom: 10px;
}
.footer-links a { color: rgba(20, 18, 31, 0.55); }
.footer-links a:hover { color: var(--amber-deep); }

.demo-note {
    margin-top: 18px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(20, 18, 31, 0.05);
    font-size: 0.86rem;
    color: rgba(20, 18, 31, 0.62);
}

.filter-bar {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 16px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 22px;
}
.filter-search {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}
.filter-search input {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--porcelain);
    font-size: 1rem;
}
.filter-search .btn { flex-shrink: 0; }
.filter-row {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
    align-items: end;
}
@media (min-width: 720px) {
    .filter-row { grid-template-columns: repeat(4, 1fr) auto; }
}
.filter-clear { margin-bottom: 2px; white-space: nowrap; }
.result-count {
    margin: 0 0 16px;
    font-size: 0.9rem;
    color: rgba(20, 18, 31, 0.55);
}

.expert-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}
@media (min-width: 720px) { .expert-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1080px) { .expert-grid { grid-template-columns: 1fr 1fr 1fr; } }

.expert-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 20px;
    min-height: 230px;
    transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.expert-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-soft);
    border-color: rgba(255, 138, 61, 0.4);
}
.expert-card-top { display: flex; gap: 14px; align-items: flex-start; }
.expert-card h2 {
    margin: 0 0 4px;
    font-family: var(--font-display);
    font-size: 1.12rem;
    letter-spacing: -0.02em;
}
.expert-meta, .expert-org, .muted {
    margin: 0;
    color: rgba(20, 18, 31, 0.58);
    font-size: 0.9rem;
}
.expert-card-foot {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
    font-size: 0.82rem;
    color: rgba(20, 18, 31, 0.55);
    padding-top: 8px;
    border-top: 1px solid var(--line);
}
.expert-card-foot .go { margin-left: auto; font-weight: 700; color: var(--amber-deep); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 100px;
    background: var(--porcelain-dim);
    color: rgba(20, 18, 31, 0.7);
}
.chip-mint { background: rgba(43, 212, 166, 0.16); color: #0d7a5c; }

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    color: #fff;
    font-weight: 700;
    font-family: var(--font-display);
    flex-shrink: 0;
    overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-md { width: 44px; height: 44px; font-size: 0.85rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1rem; }
.avatar-xl { width: 92px; height: 92px; font-size: 1.6rem; border-radius: 24px; }
.tone-amber { background: var(--amber); }
.tone-violet { background: var(--violet); }
.tone-mint { background: var(--mint); color: var(--ink); }
.tone-pink { background: var(--pink); }
.tone-ink { background: var(--ink-soft); }

.empty-state {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 40px 28px;
    text-align: center;
}
.empty-state h2 { font-family: var(--font-display); margin: 0 0 8px; }
.empty-state p { color: rgba(20, 18, 31, 0.6); }

.profile-layout {
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr;
}
@media (min-width: 960px) {
    .profile-layout { grid-template-columns: 1.5fr 0.7fr; align-items: start; }
}
.profile-hero-card {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 24px;
    box-shadow: var(--shadow-soft);
}
.profile-hero-copy h1 {
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 3vw, 2.3rem);
    margin: 6px 0 8px;
    letter-spacing: -0.03em;
}
.profile-hero-copy .lead { font-size: 1.05rem; color: rgba(20, 18, 31, 0.7); margin-bottom: 8px; }
.profile-hero-copy .eyebrow {
    display: inline-flex;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--amber-deep);
    margin: 0;
}
@media (max-width: 640px) {
    .profile-hero-card { flex-direction: column; }
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 18px 0;
}
@media (min-width: 720px) { .stat-row { grid-template-columns: repeat(5, 1fr); } }
.stat-cell {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 12px;
    text-align: center;
}
.stat-cell b {
    display: block;
    font-family: var(--font-display);
    font-size: 1.2rem;
}
.stat-cell span { font-size: 0.75rem; color: rgba(20, 18, 31, 0.5); }

.profile-block {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 22px;
    margin-bottom: 14px;
}
.profile-block h2 {
    font-family: var(--font-display);
    font-size: 1.08rem;
    margin: 0 0 12px;
}
.detail-list { margin: 0; display: grid; gap: 12px; }
.detail-list div { display: grid; gap: 2px; }
.detail-list dt { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(20, 18, 31, 0.45); }
.detail-list dd { margin: 0; }

.aside-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 22px;
    margin-bottom: 14px;
}
@media (min-width: 960px) {
    .aside-card:first-child { position: sticky; top: 88px; }
}
.aside-card h2 { font-family: var(--font-display); font-size: 1.05rem; margin: 0 0 10px; }
.rate-line { font-family: var(--font-display); font-size: 2rem; margin: 0 0 4px; letter-spacing: -0.03em; }
.rate-line small { font-size: 0.95rem; color: rgba(20, 18, 31, 0.5); margin-left: 4px; }
.aside-facts { list-style: none; margin: 14px 0 18px; padding: 0; display: grid; gap: 8px; color: rgba(20, 18, 31, 0.65); font-size: 0.92rem; }
.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.link-list a { color: var(--amber-deep); font-weight: 600; }

.inbox-list { display: grid; gap: 10px; }
.inbox-item {
    display: flex;
    gap: 14px;
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px 16px;
}
.inbox-item:hover { border-color: rgba(255, 138, 61, 0.4); }
.inbox-item.has-unread { border-color: rgba(108, 92, 224, 0.35); background: rgba(108, 92, 224, 0.04); }
.inbox-copy { flex: 1; min-width: 0; }
.inbox-top { display: flex; justify-content: space-between; gap: 10px; }
.inbox-top time { font-size: 0.78rem; color: rgba(20, 18, 31, 0.45); white-space: nowrap; }
.inbox-sub, .inbox-preview { margin: 2px 0 0; font-size: 0.88rem; color: rgba(20, 18, 31, 0.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread-dot {
    min-width: 22px; height: 22px; border-radius: 50%;
    background: var(--amber); color: var(--ink);
    font-size: 0.72rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}

.chat-shell {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 70vh;
}
.chat-head {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}
.chat-head-main { display: flex; gap: 12px; align-items: center; flex: 1; }
.chat-head h1 { font-family: var(--font-display); font-size: 1.15rem; margin: 0; }
.chat-head p { margin: 2px 0 0; font-size: 0.85rem; color: rgba(20, 18, 31, 0.55); }
.back-link { font-size: 0.85rem; font-weight: 600; color: var(--amber-deep); width: 100%; }
@media (min-width: 720px) { .back-link { width: auto; } }
.chat-stream {
    flex: 1;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    background: var(--porcelain);
    min-height: 320px;
    max-height: 52vh;
}
.chat-empty { margin: auto; color: rgba(20, 18, 31, 0.5); text-align: center; }
.bubble {
    max-width: min(78%, 520px);
    padding: 10px 14px;
    border-radius: 16px;
}
.bubble p { margin: 0; white-space: pre-wrap; }
.bubble time { display: block; margin-top: 6px; font-size: 0.72rem; opacity: .65; }
.bubble.mine { margin-left: auto; background: var(--ink); color: var(--porcelain); border-bottom-right-radius: 6px; }
.bubble.theirs { margin-right: auto; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.chat-compose {
    display: flex;
    gap: 10px;
    padding: 14px;
    border-top: 1px solid var(--line);
    background: #fff;
}
.chat-compose textarea {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    background: var(--porcelain);
    resize: none;
    font-size: 0.95rem;
}
.chat-compose .btn { align-self: flex-end; }

@media (prefers-reduced-motion: reduce) {
    .expert-card, .btn { transition: none; }
}
