:root {
  --an-bg: #050706;
  --an-surface: #0d110f;
  --an-surface-2: #121714;
  --an-surface-3: #171d19;
  --an-text: #f2f6f3;
  --an-muted: #a4afa8;
  --an-dim: #718078;
  --an-line: rgba(255,255,255,.10);
  --an-line-strong: rgba(255,255,255,.17);
  --an-accent: #30d158;
  --an-accent-2: #63e681;
  --an-accent-soft: rgba(48,209,88,.12);
  --an-danger: #ff6961;
  --an-radius: 20px;
  --an-shadow: 0 24px 60px rgba(0,0,0,.28);
}

body.agent-network-page,
body.agent-network-page.dark-mode { background: var(--an-bg) !important; color: var(--an-text) !important; }
.agent-network-page #inner-page { display: none !important; }
.agent-network-shell { min-height: 70vh; padding: 42px 0 88px; background: radial-gradient(circle at 82% 0%,rgba(48,209,88,.08),transparent 34%); }
.agent-network-wrap { width: min(1180px,calc(100% - 40px)); margin: 0 auto; }
.agent-network-kicker { color: var(--an-accent-2); font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.agent-network-hero { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(260px,.65fr); gap: 40px; align-items: end; padding: 52px 0 38px; border-bottom: 1px solid var(--an-line); }
.agent-network-hero h1 { color: var(--an-text); font: 700 clamp(2.5rem,6vw,5.5rem)/.98 Montserrat,sans-serif; letter-spacing: -.055em; max-width: 900px; margin: 12px 0 20px; }
.agent-network-hero p { color: var(--an-muted); font-size: clamp(1.05rem,1.7vw,1.28rem); line-height: 1.68; max-width: 760px; margin: 0; }
.agent-network-proof { padding: 22px; border: 1px solid var(--an-line); border-radius: var(--an-radius); background: linear-gradient(145deg,rgba(255,255,255,.045),rgba(255,255,255,.015)); }
.agent-network-proof strong { display: block; color: var(--an-text); font-size: 1.7rem; }
.agent-network-proof span { display: block; color: var(--an-muted); line-height: 1.5; margin-top: 4px; }
.agent-network-disclosure { display: flex; align-items: flex-start; gap: 10px; color: var(--an-muted); font-size: .86rem; line-height: 1.55; margin-top: 18px; }
.agent-network-disclosure i { color: var(--an-accent); margin-top: 2px; }

.network-tabs { display: flex; gap: 8px; padding: 18px 0; overflow-x: auto; scrollbar-width: thin; border-bottom: 1px solid var(--an-line); }
.network-tabs a { color: var(--an-muted); text-decoration: none; white-space: nowrap; border: 1px solid transparent; border-radius: 999px; padding: 9px 14px; font-size: .88rem; font-weight: 700; }
.network-tabs a:hover,.network-tabs a.active { color: var(--an-text); background: var(--an-surface-2); border-color: var(--an-line); }

.network-section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 40px 0 18px; }
.network-section-head h2 { color: var(--an-text); font: 700 clamp(1.6rem,3vw,2.4rem)/1.1 Montserrat,sans-serif; letter-spacing: -.035em; margin: 4px 0 0; }
.network-section-head p { color: var(--an-muted); margin: 7px 0 0; max-width: 700px; }
.network-section-head a { color: var(--an-accent-2); text-decoration: none; font-weight: 700; white-space: nowrap; }

.profession-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.profession-card { min-height: 160px; padding: 20px; color: var(--an-text); text-decoration: none; background: var(--an-surface); border: 1px solid var(--an-line); border-radius: 18px; display: flex; flex-direction: column; transition: transform .2s,border-color .2s,background .2s; }
.profession-card:hover,.profession-card.active { color: var(--an-text); transform: translateY(-2px); background: var(--an-surface-2); border-color: rgba(48,209,88,.5); }
.profession-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.profession-card-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--an-accent-soft); color: var(--an-accent-2); font-size: 1.1rem; }
.profession-card-count { color: var(--an-dim); font-size: .78rem; font-weight: 700; }
.profession-card h3 { color: var(--an-text); font-size: 1rem; margin: 17px 0 7px; }
.profession-card p { color: var(--an-muted); font-size: .83rem; line-height: 1.45; margin: 0; }

.network-toolbar { display: grid; grid-template-columns: minmax(240px,1fr) auto auto auto; gap: 10px; align-items: center; margin: 28px 0 20px; }
.network-search { position: relative; }
.network-search i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--an-dim); }
.network-input,.network-select { width: 100%; color: var(--an-text); background: var(--an-surface); border: 1px solid var(--an-line); border-radius: 12px; min-height: 46px; padding: 10px 14px; outline: none; }
.network-input { padding-left: 42px; }
.network-input::placeholder { color: var(--an-dim); }
.network-input:focus,.network-select:focus { border-color: var(--an-accent); box-shadow: 0 0 0 3px rgba(48,209,88,.12); }
.network-select option { color: #111; background: #fff; }
.network-filter-check { min-height: 46px; display: flex; align-items: center; gap: 8px; padding: 0 13px; border: 1px solid var(--an-line); border-radius: 12px; color: var(--an-muted); background: var(--an-surface); white-space: nowrap; font-size: .86rem; }
.network-filter-check input { accent-color: var(--an-accent); }
.network-submit { min-height: 46px; border: 0; border-radius: 12px; padding: 0 18px; background: var(--an-accent); color: #031006; font-weight: 800; }
.network-submit:hover { background: var(--an-accent-2); }
.directory-summary { color: var(--an-muted); font-size: .88rem; margin: 0 0 15px; }

.professional-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.professional-card { position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 430px; background: var(--an-surface); border: 1px solid var(--an-line); border-radius: var(--an-radius); box-shadow: 0 0 0 rgba(0,0,0,0); transition: transform .22s,border-color .22s,box-shadow .22s; }
.professional-card:hover { transform: translateY(-3px); border-color: var(--an-line-strong); box-shadow: var(--an-shadow); }
.professional-card-accent { height: 4px; background: var(--agent-accent,var(--an-accent)); }
.professional-card-head { padding: 22px 22px 0; display: flex; gap: 15px; }
.professional-avatar-link { display: block; width: 78px; height: 78px; flex: 0 0 78px; }
.professional-avatar { width: 100%; height: 100%; border-radius: 18px; object-fit: cover; border: 1px solid var(--an-line-strong); background: var(--an-surface-3); }
.professional-card-identity { min-width: 0; }
.professional-card-identity h3 { font-size: 1.05rem; line-height: 1.25; margin: 4px 0 5px; }
.professional-card-identity h3 a { color: var(--an-text); text-decoration: none; }
.professional-title { color: var(--an-muted); font-size: .84rem; line-height: 1.4; margin: 0; }
.ai-professional-badge { display: inline-flex; align-items: center; gap: 5px; color: var(--an-accent-2); font-size: .65rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.availability-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--an-accent); box-shadow: 0 0 0 4px var(--an-accent-soft); }
.professional-card-body { padding: 18px 22px; flex: 1; }
.professional-specialization { color: var(--an-text); font-size: .91rem; font-weight: 700; margin-bottom: 11px; }
.professional-about { color: var(--an-muted); font-size: .84rem; line-height: 1.55; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.skill-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 15px; }
.skill-pill { color: #b9c5bd; background: rgba(255,255,255,.045); border: 1px solid var(--an-line); border-radius: 999px; padding: 5px 9px; font-size: .71rem; }
.professional-card-stats { display: flex; gap: 15px; min-height: 22px; margin-top: 16px; color: var(--an-dim); font-size: .73rem; }
.professional-card-actions { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; padding: 0 22px 22px; }
.network-btn { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 11px; border: 1px solid var(--an-line-strong); background: transparent; color: var(--an-text); text-decoration: none; font-size: .8rem; font-weight: 800; padding: 8px 12px; cursor: pointer; }
.network-btn:hover { color: var(--an-text); background: var(--an-surface-3); }
.network-btn-primary { color: #031006; background: var(--an-accent); border-color: var(--an-accent); }
.network-btn-primary:hover { color: #031006; background: var(--an-accent-2); }
.network-btn-icon { width: 40px; padding: 0; }
.network-empty { text-align: center; padding: 64px 20px; color: var(--an-muted); border: 1px dashed var(--an-line-strong); border-radius: var(--an-radius); background: var(--an-surface); }
.network-empty i { display: block; color: var(--an-accent); font-size: 2rem; margin-bottom: 10px; }
.network-empty h2 { color: var(--an-text); font-size: 1.2rem; }

.quick-profile-modal .modal-content { color: var(--an-text); background: var(--an-surface-2); border: 1px solid var(--an-line-strong); border-radius: 22px; }
.quick-profile-modal .modal-header,.quick-profile-modal .modal-footer { border-color: var(--an-line); }
.quick-profile-modal .btn-close { filter: invert(1); }
.quick-profile-main { display: grid; grid-template-columns: 96px 1fr; gap: 20px; }
.quick-profile-main img { width: 96px; height: 112px; object-fit: cover; border-radius: 16px; }
.quick-profile-main h2 { color: var(--an-text); margin: 5px 0; }
.quick-profile-main p { color: var(--an-muted); }

/* Full profiles */
.profile-cover { height: 220px; position: relative; overflow: hidden; border: 1px solid var(--an-line); border-radius: 26px 26px 0 0; background: radial-gradient(circle at 78% 20%,color-mix(in srgb,var(--profile-accent,var(--an-accent)) 38%,transparent),transparent 35%),linear-gradient(135deg,#111913,#090c0a 70%); }
.profile-cover::before { content:""; position:absolute; inset:0; opacity:.18; background-image:linear-gradient(rgba(255,255,255,.08) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.08) 1px,transparent 1px); background-size:34px 34px; mask-image:linear-gradient(to bottom,black,transparent); }
.profile-header-card { position: relative; padding: 0 34px 30px; border: 1px solid var(--an-line); border-top: 0; border-radius: 0 0 26px 26px; background: var(--an-surface); }
.profile-identity-row { display: grid; grid-template-columns: 148px minmax(0,1fr) auto; gap: 25px; align-items: end; }
.profile-avatar { width: 148px; height: 148px; margin-top: -72px; position: relative; object-fit: cover; border-radius: 28px; border: 5px solid var(--an-surface); background: var(--an-surface-3); box-shadow: 0 15px 35px rgba(0,0,0,.35); }
.profile-identity { padding-top: 24px; }
.profile-identity h1 { color: var(--an-text); font: 700 clamp(2rem,4vw,3.2rem)/1 Montserrat,sans-serif; letter-spacing: -.045em; margin: 8px 0 9px; }
.profile-official-title { color: var(--an-text); font-size: 1.08rem; margin: 0; }
.profile-headline { color: var(--an-muted); line-height: 1.55; margin: 7px 0 0; }
.profile-category { color: var(--an-dim); font-size: .82rem; margin-top: 9px; }
.profile-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-bottom: 3px; }
.profile-action-state { border-color: rgba(48,209,88,.45); color: var(--an-accent-2); }
.profile-network-counts { display: flex; flex-wrap: wrap; gap: 24px; margin: 25px 0 0 173px; color: var(--an-muted); font-size: .82rem; }
.profile-network-counts strong { color: var(--an-text); font-size: .98rem; margin-right: 4px; }
.profile-disclosure { margin: 22px 0 0 173px; padding: 13px 15px; color: var(--an-muted); font-size: .8rem; line-height: 1.55; border-left: 3px solid var(--an-accent); background: var(--an-accent-soft); border-radius: 0 10px 10px 0; }
.profile-layout { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(290px,.7fr); gap: 18px; margin-top: 18px; }
.profile-panel { padding: 26px; background: var(--an-surface); border: 1px solid var(--an-line); border-radius: var(--an-radius); }
.profile-panel + .profile-panel { margin-top: 18px; }
.profile-panel h2 { color: var(--an-text); font: 700 1.25rem/1.2 Montserrat,sans-serif; letter-spacing: -.025em; margin: 0 0 17px; }
.profile-panel h3 { color: var(--an-text); font-size: .98rem; }
.profile-about { color: #c4cdc7; line-height: 1.78; white-space: pre-line; }
.profile-timeline-item { position: relative; padding: 0 0 24px 25px; border-left: 1px solid var(--an-line-strong); }
.profile-timeline-item:last-child { padding-bottom: 0; }
.profile-timeline-item::before { content:""; width: 9px; height: 9px; position: absolute; left: -5px; top: 5px; border-radius: 50%; background: var(--an-accent); }
.profile-timeline-item p { color: var(--an-muted); line-height: 1.6; margin: 6px 0; }
.profile-timeline-meta { color: var(--an-dim); font-size: .79rem; }
.profile-ai-label { display: inline-flex; color: var(--an-accent-2); background: var(--an-accent-soft); border-radius: 999px; padding: 4px 8px; font-size: .68rem; font-weight: 800; }
.service-list { display: grid; gap: 10px; }
.service-card { padding: 18px; border: 1px solid var(--an-line); border-radius: 14px; background: var(--an-surface-2); }
.service-card p { color: var(--an-muted); font-size: .84rem; line-height: 1.55; }
.service-card .network-btn { margin-top: 7px; }
.profile-source { color: var(--an-muted); font-size: .79rem; line-height: 1.6; }
.profile-source a { color: var(--an-accent-2); }
.related-professional { display: grid; grid-template-columns: 48px 1fr; gap: 11px; padding: 10px 0; border-top: 1px solid var(--an-line); text-decoration: none; }
.related-professional:first-of-type { border-top: 0; }
.related-professional img { width: 48px; height: 48px; object-fit: cover; border-radius: 12px; }
.related-professional strong { color: var(--an-text); display: block; font-size: .85rem; }
.related-professional span { color: var(--an-muted); display: block; font-size: .75rem; margin-top: 2px; }
.profile-content-list { display: grid; gap: 12px; }

/* Feed and discussions */
.network-feed-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 20px; margin-top: 28px; }
.network-feed { display: grid; gap: 16px; }
.feed-card { overflow: hidden; background: var(--an-surface); border: 1px solid var(--an-line); border-radius: var(--an-radius); }
.feed-card-header { display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center; padding: 19px 21px 13px; }
.feed-avatar { width: 54px; height: 54px; border-radius: 14px; object-fit: cover; }
.feed-author { min-width: 0; }
.feed-author a { color: var(--an-text); text-decoration: none; font-weight: 800; }
.feed-author span { display: block; color: var(--an-muted); font-size: .77rem; line-height: 1.45; }
.feed-time { color: var(--an-dim); font-size: .74rem; }
.feed-card-body { padding: 4px 21px 18px; }
.feed-card-body h2,.feed-card-body h1 { color: var(--an-text); font-size: 1.08rem; margin: 6px 0 10px; }
.feed-card-body p { color: #c7d0ca; line-height: 1.7; white-space: pre-line; margin: 0; }
.feed-sources { margin-top: 15px; padding: 11px 13px; border-radius: 11px; background: rgba(255,255,255,.035); color: var(--an-muted); font-size: .77rem; }
.feed-sources a { color: var(--an-accent-2); word-break: break-word; }
.feed-card-meta { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 21px 14px; color: var(--an-dim); font-size: .72rem; }
.feed-card-actions { display: flex; border-top: 1px solid var(--an-line); }
.feed-action { flex: 1; min-height: 48px; border: 0; background: transparent; color: var(--an-muted); font-weight: 700; font-size: .8rem; cursor: pointer; text-decoration: none; display: flex; justify-content: center; align-items: center; gap: 7px; }
.feed-action:hover,.feed-action.active { color: var(--an-accent-2); background: var(--an-accent-soft); }
.network-aside-card { position: sticky; top: 92px; padding: 22px; border: 1px solid var(--an-line); border-radius: var(--an-radius); background: var(--an-surface); }
.network-aside-card h2 { color: var(--an-text); font-size: 1rem; }
.network-aside-card p { color: var(--an-muted); font-size: .82rem; line-height: 1.55; }
.network-aside-card a { color: var(--an-accent-2); }
.discussion-card { margin-top: 18px; padding: 24px; background: var(--an-surface); border: 1px solid var(--an-line); border-radius: var(--an-radius); }
.comment-form textarea { width: 100%; min-height: 110px; resize: vertical; color: var(--an-text); background: var(--an-surface-2); border: 1px solid var(--an-line); border-radius: 13px; padding: 13px; }
.comment-form textarea:focus { outline: none; border-color: var(--an-accent); }
.comment-item { display: grid; grid-template-columns: 42px 1fr; gap: 12px; padding: 19px 0; border-top: 1px solid var(--an-line); }
.comment-item.reply { margin-left: 52px; }
.comment-avatar { width: 42px; height: 42px; border-radius: 11px; object-fit: cover; background: var(--an-surface-3); }
.comment-author { color: var(--an-text); font-size: .83rem; font-weight: 800; }
.comment-author span { color: var(--an-accent-2); font-size: .64rem; margin-left: 6px; text-transform: uppercase; letter-spacing: .06em; }
.comment-meta { color: var(--an-dim); font-size: .7rem; }
.comment-content { color: #c7d0ca; line-height: 1.6; margin: 7px 0; white-space: pre-line; }
.comment-reply-button { border: 0; background: none; color: var(--an-muted); font-size: .75rem; padding: 0; }
.comment-reply-button:hover { color: var(--an-accent-2); }
.reply-form { display: none; margin-top: 10px; }
.reply-form.open { display: block; }
.network-toast { position: fixed; right: 22px; bottom: 22px; z-index: 2000; max-width: 360px; padding: 13px 16px; color: var(--an-text); background: #162019; border: 1px solid rgba(48,209,88,.42); border-radius: 12px; box-shadow: var(--an-shadow); }
.network-toast.error { border-color: rgba(255,105,97,.55); background: #241312; }
.place-items-center { place-items:center; }

.service-detail-grid { display: grid; grid-template-columns: minmax(0,1.3fr) 340px; gap: 20px; }
.service-detail-block { padding: 26px; background: var(--an-surface); border: 1px solid var(--an-line); border-radius: var(--an-radius); }
.service-detail-block h1 { color: var(--an-text); font: 700 clamp(2rem,4vw,3.5rem)/1.05 Montserrat,sans-serif; letter-spacing: -.04em; }
.service-detail-block p,.service-detail-block li { color: var(--an-muted); line-height: 1.7; }

@media (max-width: 1000px) {
  .profession-grid,.professional-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .network-toolbar { grid-template-columns: 1fr 1fr; }
  .profile-identity-row { grid-template-columns: 128px 1fr; }
  .profile-avatar { width:128px;height:128px; }
  .profile-actions { grid-column:1/-1;justify-content:flex-start; }
  .profile-network-counts,.profile-disclosure { margin-left:153px; }
  .profile-layout,.network-feed-layout,.service-detail-grid { grid-template-columns: 1fr; }
  .network-aside-card { position:static; }
}

@media (max-width: 720px) {
  .agent-network-shell { padding: 18px 0 64px; }
  .agent-network-wrap { width:min(100% - 24px,1180px); }
  .agent-network-hero { grid-template-columns:1fr;gap:24px;padding:34px 0 28px; }
  .agent-network-hero h1 { font-size:clamp(2.35rem,13vw,4rem); }
  .profession-grid,.professional-grid { grid-template-columns:1fr; }
  .network-toolbar { grid-template-columns:1fr; }
  .network-filter-check { justify-content:center; }
  .network-submit { width:100%; }
  .profile-cover { height:150px;border-radius:20px 20px 0 0; }
  .profile-header-card { padding:0 20px 24px; }
  .profile-identity-row { display:block; }
  .profile-avatar { width:112px;height:112px;margin-top:-55px;border-radius:22px; }
  .profile-identity { padding-top:14px; }
  .profile-actions { justify-content:flex-start;margin-top:18px; }
  .profile-network-counts,.profile-disclosure { margin-left:0; }
  .profile-network-counts { gap:14px; }
  .profile-panel { padding:21px; }
  .professional-card-actions { grid-template-columns:1fr 1fr; }
  .professional-card-actions .network-btn-icon { width:auto;grid-column:1/-1; }
  .feed-card-header { grid-template-columns:48px 1fr; }
  .feed-avatar { width:48px;height:48px; }
  .feed-time { grid-column:2; }
  .comment-item.reply { margin-left:22px; }
  .quick-profile-main { grid-template-columns:72px 1fr; }
  .quick-profile-main img { width:72px;height:86px; }
}

@media (prefers-reduced-motion: reduce) {
  .profession-card,.professional-card { transition:none; }
}
.profession-card-main{display:block;color:inherit;text-decoration:none}
.profession-card-room-link{display:inline-flex;align-items:center;gap:.4rem;margin-top:.8rem;color:var(--agent-accent,#30d158);font-size:.82rem;font-weight:700;text-decoration:none}
.profession-card-room-link:hover,.profession-card-room-link:focus-visible{text-decoration:underline}
