/* MahaWork — design system */
:root {
  --brand: #2f4bd8; --brand-600: #2440c4; --brand-50: #eef1ff; --brand-100: #dfe5ff;
  --accent: #ff7a14; --accent-600: #ec6a06;
  --ink: #141a2e; --ink-2: #39415a; --muted: #6b7390; --line: #e4e7f0; --line-2: #eef0f6;
  --bg: #f6f7fb; --surface: #ffffff;
  --success: #12805c; --success-bg: #e3f6ee; --warn: #9a5b00; --warn-bg: #fff3dc;
  --danger: #c4283a; --danger-bg: #fde8ea; --info: #2f4bd8; --info-bg: #eef1ff;
  --verified: #1d9bf0;
  --radius: 14px; --radius-sm: 10px; --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(20,26,46,.06), 0 1px 3px rgba(20,26,46,.05);
  --shadow: 0 4px 16px rgba(20,26,46,.08);
  --shadow-lg: 0 18px 50px rgba(20,26,46,.18);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --container: 1200px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 15.5px; line-height: 1.55; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.danger { color: var(--danger); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
.section { padding-top: 48px; padding-bottom: 48px; }
.section-sm { margin-top: 24px; }
.stack > * + * { margin-top: 14px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-form input:not([type=checkbox]), .row-form select { flex: 1 1 160px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.inline { display: inline; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: .95rem; padding: 10px 18px; border-radius: 999px; border: 1.5px solid transparent; cursor: pointer; text-decoration: none !important; transition: background .15s, border-color .15s, transform .05s, box-shadow .15s; white-space: nowrap; line-height: 1.2; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(47,75,216,.25); }
.btn-primary:hover { background: var(--brand-600); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(255,122,20,.3); }
.btn-accent:hover { background: var(--accent-600); }
.btn-outline { background: var(--surface); color: var(--brand); border-color: var(--brand-100); }
.btn-outline:hover { border-color: var(--brand); background: var(--brand-50); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); }
.btn-light { background: rgba(255,255,255,.92); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.95); }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .84rem; }
.btn-lg { padding: 13px 24px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; }
.linklike.danger { color: var(--danger); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field > legend { font-weight: 600; font-size: .88rem; color: var(--ink-2); padding: 0; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  font: inherit; width: 100%; padding: 10px 13px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
textarea { resize: vertical; min-height: 44px; }
input[type=file] { font: inherit; font-size: .9rem; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .93rem; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--brand); width: 17px; height: 17px; flex: none; }
.field-error { color: var(--danger); font-weight: 600; font-size: .82rem; }
.chip-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-checks label { display: inline-flex; gap: 6px; align-items: center; padding: 7px 12px; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer; font-size: .9rem; background: var(--surface); }
.chip-checks label:has(input:checked) { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
.chip-checks input { accent-color: var(--brand); }
.radio-list { display: grid; gap: 10px; }
.card-radio { padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); }
.card-radio:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.card-radio span { display: flex; flex-direction: column; gap: 2px; }
.narrow-form { max-width: 520px; }

/* Alerts, chips, toasts */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin: 16px 0; font-size: .94rem; border: 1px solid transparent; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: #bfe8d6; }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: #f6c6cc; }
.alert-warn { background: var(--warn-bg); color: var(--warn); border-color: #f7dfa9; }
.alert-info { background: var(--info-bg); color: var(--brand-600); border-color: var(--brand-100); }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.chip-success { background: var(--success-bg); color: var(--success); }
.chip-info { background: var(--info-bg); color: var(--brand); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-danger { background: var(--danger-bg); color: var(--danger); }
.chip-muted { background: var(--line-2); color: var(--muted); }
.toasts { position: fixed; top: 76px; right: 16px; z-index: 1000; display: grid; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: .92rem; max-width: 340px; animation: toastIn .2s ease; transition: opacity .4s, transform .4s; }
.toast-success { background: var(--success); } .toast-error { background: var(--danger); }
.toast.out { opacity: 0; transform: translateY(-6px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }
.announcement { background: var(--ink); color: #fff; text-align: center; padding: 8px 16px; font-size: .88rem; }

/* Avatars & badge */
.avatar { border-radius: 50%; object-fit: cover; flex: none; background: var(--line-2); }
.avatar-sm { width: 34px; height: 34px; font-size: .8rem; }
.avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.3rem; }
.avatar-xl { width: 120px; height: 120px; font-size: 2.4rem; border: 4px solid var(--surface); box-shadow: var(--shadow); }
.avatar-initials { display: inline-grid; place-items: center; font-weight: 800; color: #fff; background: hsl(var(--hue, 228) 62% 52%); }
.badge-verified { position: relative; display: inline-flex; color: var(--verified); vertical-align: -2px; cursor: help; }
.badge-verified::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 240px; background: var(--ink); color: #fff; font-size: .75rem; font-weight: 500; line-height: 1.35; padding: 7px 10px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 20; white-space: normal; text-align: left; }
.badge-verified:hover::after, .badge-verified:focus::after, .badge-verified.show-tip::after { opacity: 1; }
.vtick { color: var(--verified); vertical-align: -2px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 24px; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-size: 1.22rem; font-weight: 600; text-decoration: none !important; }
.brand b { color: var(--brand); font-weight: 800; }
.brand small { font-size: .7rem; color: var(--muted); font-weight: 600; margin-left: 4px; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), #5a74ff); color: #fff; font-weight: 800; font-size: 1.05rem; position: relative; }
.brand-mark::after { content: ''; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; }
.brand-mark.big { width: 56px; height: 56px; font-size: 1.6rem; border-radius: 16px; margin: 0 auto 12px; }
.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.main-nav > a { padding: 8px 12px; border-radius: 999px; color: var(--ink-2); font-weight: 600; font-size: .93rem; }
.main-nav > a:hover { background: var(--line-2); text-decoration: none; }
.main-nav > a[aria-current] { color: var(--brand); background: var(--brand-50); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: var(--ink-2); }
.icon-btn:hover { background: var(--line-2); }
.dot-count { position: absolute; top: 2px; right: 0; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff; line-height: 1; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; width: 42px; height: 42px; cursor: pointer; flex-direction: column; justify-content: center; gap: 5px; align-items: center; }
.nav-toggle span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: .2s; }
.profile-menu, .more-menu, .chat-menu { position: relative; }
.profile-menu summary, .more-menu summary, .chat-menu summary { list-style: none; cursor: pointer; }
.profile-menu summary::-webkit-details-marker, .more-menu summary::-webkit-details-marker, .chat-menu summary::-webkit-details-marker { display: none; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 220px; padding: 6px; z-index: 60; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; color: var(--ink); background: none; border: 0; font: inherit; font-size: .92rem; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--line-2); text-decoration: none; }
.menu-head { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; }
.menu-head small { color: var(--muted); }

/* Hero & home */
.hero { background: radial-gradient(1200px 400px at 80% -10%, rgba(255,122,20,.18), transparent 60%), radial-gradient(900px 500px at 0% 0%, rgba(90,116,255,.25), transparent 60%), linear-gradient(180deg, #f1f3ff, var(--bg)); padding: 72px 0 56px; }
.hero-inner { max-width: 880px; text-align: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.08; letter-spacing: -.025em; }
.lead { font-size: 1.1rem; color: var(--ink-2); }
.hero-search { display: flex; gap: 8px; background: var(--surface); padding: 8px; border-radius: 999px; box-shadow: var(--shadow-lg); margin: 28px auto 18px; max-width: 720px; }
.hero-search input, .hero-search select { border: 0 !important; box-shadow: none !important; border-radius: 999px; }
.hero-search input { flex: 1; padding-left: 18px; }
.hero-search select { width: auto; max-width: 160px; background: var(--line-2); }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; color: var(--ink-2); font-weight: 600; font-size: .92rem; }
.type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: -20px; }
.type-tile { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; color: var(--ink); box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s; }
.type-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--brand-100); text-decoration: none; }
.type-icon { font-size: 1.8rem; }
.type-count { color: var(--brand); font-weight: 700; font-size: .88rem; margin-top: 6px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.steps li { padding: 24px; border-radius: var(--radius); background: var(--bg); }
.steps span { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; margin-bottom: 12px; }
.split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.price-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow); }
.price-card-lg { padding: 36px; }
.price-name { font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .06em; font-size: .82rem; }
.price { font-size: 2.8rem; font-weight: 800; letter-spacing: -.03em; margin: 6px 0 16px; }
.price small { font-size: 1rem; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.checks { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 10px; }
.checks li { padding-left: 28px; position: relative; }
.checks li::before { content: '✓'; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--success-bg); color: var(--success); font-weight: 800; font-size: .75rem; display: grid; place-items: center; }
.faq { display: grid; gap: 10px; margin-top: 20px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 18px; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq details p { margin: 10px 0 0; color: var(--ink-2); }
.cta-band { text-align: center; background: linear-gradient(135deg, var(--brand), #5a74ff); color: #fff; border-radius: var(--radius-lg); margin-bottom: 56px; }
.cta-band p { opacity: .9; }

/* Profile cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.pcard { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s; }
.pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--brand-100); }
.pcard-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.pcard-name { font-size: 1.05rem; margin: 0 0 2px; display: flex; align-items: center; gap: 6px; }
.pcard-name a { color: var(--ink); }
.stretched::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.pcard-headline { color: var(--ink-2); font-size: .9rem; margin: 0 0 6px; font-weight: 500; }
.pcard-loc { display: flex; gap: 4px; align-items: center; color: var(--muted); font-size: .84rem; margin: 0 0 8px; }
.pcard-bio { color: var(--muted); font-size: .86rem; margin: 0 0 10px; }
.pcard-actions { margin-top: auto; padding-top: 12px; position: relative; z-index: 2; }
.pcard .badge-verified { z-index: 2; }
.type-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); font-size: .74rem; font-weight: 700; }
.type-freelancer { background: #eef1ff; color: #2f4bd8; } .type-creator { background: #fdeefa; color: #b0218f; }
.type-agency { background: #e6f7f3; color: #0c7a63; } .type-workplace { background: #fff2e5; color: #b8560a; }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { background: var(--bg); border: 1px solid var(--line); padding: 3px 9px; border-radius: 999px; font-size: .76rem; color: var(--ink-2); font-weight: 600; }
.tags-lg li { font-size: .86rem; padding: 0; }
.tags-lg li a { display: block; padding: 5px 12px; color: var(--ink-2); }

/* Discover */
.page-head { padding: 36px 0 20px; background: linear-gradient(180deg, #eef1ff, var(--bg)); }
.discover { display: grid; grid-template-columns: 270px 1fr; gap: 28px; padding-bottom: 56px; align-items: start; }
.filter-toggle > summary { display: none; list-style: none; }
.filter-toggle > summary::-webkit-details-marker { display: none; }
.filter-toggle { position: sticky; top: 86px; }
.filters { position: relative; top: 86px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 14px; }
.filter-actions { display: grid; gap: 6px; }
.result-count { margin: 0 0 14px; color: var(--ink-2); }
.empty { background: var(--surface); border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 44px 24px; text-align: center; }
.pagination { display: flex; gap: 6px; justify-content: center; margin: 28px 0 0; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: .9rem; }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Full profile */
.cover { height: 240px; background: linear-gradient(120deg, #2f4bd8 0%, #6a7dff 55%, #ff9a4d 100%); background-size: cover; background-position: center; }
.profile-head { display: flex; gap: 24px; align-items: flex-end; margin-top: -60px; flex-wrap: wrap; }
.profile-id { flex: 1; min-width: 240px; padding-bottom: 6px; }
.profile-id h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 70px 0 4px; }
.profile-id .lead { margin: 0 0 8px; }
.profile-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.profile-cta { display: flex; gap: 8px; align-items: center; padding-bottom: 10px; }
.profile-body { display: grid; grid-template-columns: 1fr 320px; gap: 24px; padding: 28px 20px 56px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.panel > h2:first-child { font-size: 1.08rem; }
.prose { white-space: normal; color: var(--ink-2); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: .92rem; }
.facts dt { color: var(--muted); font-weight: 600; } .facts dd { margin: 0; overflow-wrap: anywhere; }
.link-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.verify-note { display: flex; gap: 10px; align-items: flex-start; background: #eaf6ff; border: 1px solid #c6e6fb; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; font-size: .9rem; }
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.portfolio-item { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.portfolio-item img, .portfolio-ph { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--line-2); display: grid; place-items: center; font-size: 2rem; }
.portfolio-item figcaption { padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; font-size: .9rem; }
.safety-panel { background: #fffaf3; border-color: #f5e3c8; }

/* Auth */
.auth { min-height: calc(100vh - 66px - 200px); display: grid; place-items: center; padding: 40px 16px; }
.bare .auth { min-height: 100vh; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow); }
.auth-card form { display: grid; gap: 14px; margin: 20px 0; }
.auth-wide { max-width: 640px; }
.type-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type-choice { display: flex; gap: 10px; padding: 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.type-choice:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.type-choice input { accent-color: var(--brand); margin-top: 3px; }
.type-choice span { display: flex; flex-direction: column; } .type-choice small { color: var(--muted); font-size: .8rem; }

/* Dashboard */
.dash { display: grid; grid-template-columns: 230px 1fr; gap: 28px; padding: 28px 20px 56px; align-items: start; }
.dash-nav { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.dash-nav a, .dash-nav .linklike { padding: 9px 12px; border-radius: 9px; color: var(--ink-2); font-weight: 600; font-size: .92rem; text-align: left; width: 100%; }
.dash-nav a:hover { background: var(--line-2); text-decoration: none; }
.dash-nav a[aria-current] { background: var(--brand-50); color: var(--brand); }
.dash-main { min-width: 0; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.dash-head h1 { margin-bottom: 4px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.stat { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; color: var(--ink); }
a.stat:hover { border-color: var(--brand-100); box-shadow: var(--shadow-sm); text-decoration: none; }
.stat-label { color: var(--muted); font-size: .82rem; font-weight: 600; }
.stat-value { font-size: 1.5rem; font-weight: 800; }
.meter { display: block; height: 7px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #6a7dff); border-radius: 99px; }
.usage-list, .notif-list, .simple-list, .doc-list, .doc-types, .timeline { list-style: none; padding: 0; margin: 0; }
.usage-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.usage-list .meter { grid-column: 1 / -1; }
.notif-list li a { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 10px; color: var(--ink); }
.notif-list li a:hover { background: var(--bg); text-decoration: none; }
.notif-list li.unread a { background: var(--brand-50); }
.simple-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.simple-list li form { margin-left: auto; }
.doc-list li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.doc-list li .btn, .doc-list li form { margin-left: auto; }
.doc-types li { padding: 6px 0; font-size: .92rem; }
.timeline li { padding: 8px 0 8px 16px; border-left: 2px solid var(--line); }
.upload-box { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; background: var(--bg); padding: 16px; border-radius: var(--radius-sm); margin-top: 16px; }
.verify-done { display: flex; gap: 16px; align-items: flex-start; }
.verify-done .badge-verified svg { width: 40px; height: 40px; }
.media-panel { padding: 0; overflow: hidden; }
.cover-edit { height: 170px; background: linear-gradient(120deg, #2f4bd8 0%, #6a7dff 55%, #ff9a4d 100%); background-size: cover; background-position: center; display: flex; justify-content: flex-end; align-items: flex-start; padding: 12px; }
.avatar-edit { display: flex; align-items: center; gap: 16px; padding: 0 22px 18px; margin-top: -48px; flex-wrap: wrap; }
.avatar-edit .avatar-xl { width: 100px; height: 100px; }
.upload-inline { display: inline; }
.sticky-save { position: sticky; bottom: 0; padding-right: 76px !important; background: linear-gradient(180deg, transparent, var(--bg) 40%); padding: 18px 0 8px; display: flex; justify-content: flex-end; z-index: 5; }
.plan-status { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.reply { background: var(--bg); padding: 12px 14px; border-radius: 10px; border-left: 3px solid var(--brand); }
.danger-zone { border-color: #f6c6cc; }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel .table-wrap { border: 0; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--bg); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }

/* Modal */
.modal { border: 0; border-radius: var(--radius-lg); padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgba(20,26,46,.5); }
.modal-body { padding: 26px; display: grid; gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Footer */
.site-footer { background: var(--ink); color: #c8cde0; padding: 48px 0 24px; margin-top: 40px; }
.site-footer .brand { color: #fff; } .site-footer .brand b { color: #9fb0ff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 28px; }
.footer-grid h4 { color: #fff; font-size: .9rem; margin-bottom: 12px; }
.footer-grid a:not(.brand) { display: block; color: #c8cde0; font-size: .9rem; padding: 3px 0; }
.site-footer .muted { color: #8d94b0; }
.footer-bottom { border-top: 1px solid #2a3150; margin-top: 32px; padding-top: 18px; font-size: .85rem; }

/* Static pages / errors */
.static-page h2 { margin-top: 1.6em; } .static-page h3 { margin-top: 1.3em; }
.static-page ul { padding-left: 1.2em; } .static-page li { margin: .3em 0; }
.error-page { padding: 80px 20px; }
.error-code { font-size: 4.5rem; font-weight: 800; color: var(--brand-100); line-height: 1; }
.debug { text-align: left; background: #111; color: #eee; padding: 16px; border-radius: 10px; overflow: auto; font-size: .78rem; max-height: 400px; }

/* ------------------------------------------------------------------ */
/* Chat (Facebook-style dock)                                          */
/* ------------------------------------------------------------------ */
.chat-dock { position: fixed; right: 92px; bottom: 0; display: flex; flex-direction: row-reverse; align-items: flex-end; gap: 12px; z-index: 80; pointer-events: none; }
.chat-win { pointer-events: auto; width: 338px; height: 460px; background: var(--surface); border-radius: 14px 14px 0 0; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); animation: chatIn .18s ease; }
@keyframes chatIn { from { transform: translateY(20px); opacity: 0; } }
.chat-win.minimized { height: 52px; }
.chat-win.minimized .chat-body, .chat-win.minimized .chat-foot { display: none; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface); min-height: 52px; }
.chat-title { display: flex; align-items: center; gap: 9px; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; min-width: 0; flex: 1; text-align: left; }
.chat-name { font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-tools { display: flex; align-items: center; gap: 2px; }
.chat-tools > button, .chat-menu summary { width: 32px; height: 32px; border-radius: 50%; border: 0; background: none; display: grid; place-items: center; cursor: pointer; font-size: 1.2rem; color: var(--brand); line-height: 1; }
.chat-tools > button:hover, .chat-menu summary:hover { background: var(--line-2); }
.chat-menu .menu { min-width: 180px; }
.chat-body { flex: 1; overflow-y: auto; padding: 12px; background: #fafbfe; overscroll-behavior: contain; }
.chat-msgs { display: flex; flex-direction: column; gap: 4px; }
.chat-older { display: block; margin: 0 auto 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .8rem; cursor: pointer; color: var(--brand); }
.chat-empty { text-align: center; color: var(--muted); padding: 40px 12px; font-size: .9rem; }
.date-sep { text-align: center; font-size: .72rem; color: var(--muted); margin: 10px 0 6px; font-weight: 600; }
.msg { max-width: 78%; display: flex; flex-direction: column; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg.theirs { align-self: flex-start; }
.msg-body { padding: 8px 13px; border-radius: 18px; font-size: .92rem; line-height: 1.4; overflow-wrap: anywhere; }
.msg.mine .msg-body { background: var(--brand); color: #fff; border-bottom-right-radius: 5px; }
.msg.theirs .msg-body { background: #e9ebf3; color: var(--ink); border-bottom-left-radius: 5px; }
.msg.pending .msg-body { opacity: .65; }
.msg.failed .msg-body { background: var(--danger-bg); color: var(--danger); }
.msg.removed .msg-body { background: transparent; border: 1px dashed var(--line); color: var(--muted); font-style: italic; }
.msg-meta { font-size: .68rem; color: var(--muted); padding: 2px 6px; display: flex; gap: 6px; }
.retry { background: none; border: 0; color: var(--danger); font: inherit; font-weight: 700; cursor: pointer; padding: 0; }
.chat-foot { border-top: 1px solid var(--line); padding: 8px 10px 10px; background: var(--surface); }
.quota { display: block; font-size: .74rem; color: var(--muted); margin: 0 0 6px 4px; font-weight: 600; }
.quota.low { color: var(--warn); } .quota.pro { color: var(--success); }
.chat-form { display: flex; gap: 6px; align-items: flex-end; }
.chat-form textarea { border-radius: 20px; padding: 9px 14px; background: var(--bg); border-color: transparent; max-height: 120px; min-height: 40px; font-size: .92rem; }
.chat-send { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; cursor: pointer; }
.chat-send:hover { background: var(--brand-600); }
.chat-note { margin: 4px; font-size: .85rem; color: var(--muted); text-align: center; }
.paywall { background: linear-gradient(135deg, #fff7ef, #fff); border: 1px solid #ffd9b8; border-radius: 12px; padding: 12px; font-size: .85rem; }
.paywall p { margin: 6px 0 10px; color: var(--ink-2); }
.chat-launcher { position: fixed; right: 20px; bottom: 20px; z-index: 85; }
.chat-fab { position: relative; width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 24px rgba(47,75,216,.4); transition: transform .15s; }
.chat-fab:hover { transform: scale(1.05); }
.chat-fab .dot-count { top: -2px; right: -2px; }
.chat-list-panel { position: absolute; right: 0; bottom: 70px; width: 340px; max-height: 460px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; }
.chat-list-panel header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chat-list { overflow-y: auto; padding: 6px; }
.chat-list-empty { padding: 20px; text-align: center; font-size: .9rem; }
.conv { display: flex; gap: 10px; align-items: center; width: 100%; padding: 10px; border: 0; background: none; border-radius: 10px; text-align: left; font: inherit; cursor: pointer; color: var(--ink); }
.conv:hover, .conv.active { background: var(--bg); }
.conv.active { background: var(--brand-50); }
.conv-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.conv-name { font-weight: 600; font-size: .92rem; }
.conv-preview { font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv.unread .conv-name, .conv.unread .conv-preview { font-weight: 800; color: var(--ink); }
.conv-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: .72rem; color: var(--muted); }
.conv-meta .dot-count { position: static; border: 0; }

/* Inbox page */
.inbox { display: grid; grid-template-columns: 300px 1fr; height: min(70vh, 680px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.inbox-list { border-right: 1px solid var(--line); overflow-y: auto; padding: 6px; }
.inbox-thread { display: flex; flex-direction: column; min-height: 0; }
.inbox-placeholder { display: grid; place-items: center; height: 100%; padding: 24px; text-align: center; }
.inbox-back { display: none; }
.chat-inline { width: auto; height: 100%; border: 0; border-radius: 0; box-shadow: none; animation: none; flex: 1; min-height: 0; }
.inbox-empty { padding: 20px; }

/* ------------------------------------------------------------------ */
/* Admin                                                               */
/* ------------------------------------------------------------------ */
.admin-body { background: #f3f4f9; }
.admin { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.admin-side { background: var(--ink); color: #c8cde0; padding: 20px 14px; display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-side .brand { color: #fff; margin: 0 6px 10px; } .admin-side .brand b { color: #9fb0ff; } .admin-side .brand small { color: #8d94b0; }
.admin-side nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.admin-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #6f7799; margin: 14px 10px 4px; font-weight: 700; }
.admin-side nav a { color: #c8cde0; padding: 8px 10px; border-radius: 8px; font-size: .9rem; font-weight: 500; }
.admin-side nav a:hover { background: #222a47; text-decoration: none; }
.admin-side nav a[aria-current] { background: var(--brand); color: #fff; }
.admin-me { border-top: 1px solid #2a3150; padding: 12px 8px 0; display: flex; flex-direction: column; font-size: .88rem; }
.admin-me small { color: #8d94b0; }
.admin-me .linklike { color: #9fb0ff; text-align: left; margin-top: 6px; }
.admin-main { padding: 24px 32px 60px; min-width: 0; }
.admin-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.admin-top h1 { font-size: 1.5rem; margin: 0; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; flex: 0 1 220px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.kpi-sm { margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi-label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; }
.kpi-sub { font-size: .76rem; color: var(--muted); }
.bars { display: flex; gap: 6px; align-items: flex-end; height: 160px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.bar span { width: 100%; max-width: 26px; background: linear-gradient(180deg, #6a7dff, var(--brand)); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bar small { font-size: .68rem; color: var(--muted); }
.hbar { display: grid; grid-template-columns: 140px 1fr 40px; gap: 10px; align-items: center; font-size: .86rem; padding: 4px 0; }
.hbar-track { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.hbar-track span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.hbar b { text-align: right; }
.decision { background: var(--bg); padding: 16px; border-radius: var(--radius-sm); }
.notes { background: var(--bg); padding: 12px; border-radius: 10px; font-size: .82rem; white-space: pre-wrap; max-height: 220px; overflow: auto; }
.role-card { background: var(--bg); padding: 16px; border-radius: var(--radius-sm); }
.faq-admin { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.export-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.convo-review { display: grid; gap: 10px; }
.cr-msg { padding: 10px 14px; border-radius: 10px; background: var(--bg); }
.cr-msg p { margin: 4px 0 8px; }
.cr-reported { background: #fff6ec; border-left: 3px solid var(--accent); }

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */
@media (max-width: 1024px) {
  .type-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-body { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .main-nav { display: none; position: absolute; top: 66px; left: 0; right: 0; background: var(--surface); flex-direction: column; align-items: stretch; padding: 12px 16px 18px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .nav-open .main-nav { display: flex; }
  .main-nav > a { padding: 12px; }
  .nav-actions { margin: 10px 0 0; justify-content: flex-start; flex-wrap: wrap; }
  .discover, .dash { grid-template-columns: 1fr; }
  .filter-toggle, .dash-nav { position: static; }
  .filter-toggle > summary { display: flex; margin-bottom: 12px; }
  .dash-nav { flex-direction: row; overflow-x: auto; white-space: nowrap; padding: 6px; }
  .dash-nav a, .dash-nav .linklike { width: auto; }
  .dash-nav form { display: none; }
  .split { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .admin { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; }
  .admin-side nav { flex-direction: row; flex-wrap: wrap; }
  .admin-group { width: 100%; }
  .admin-main { padding: 18px 16px 40px; }
  .upload-box { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .container { padding: 0 16px; }
  .grid-2, .type-choices { grid-template-columns: 1fr; }
  .type-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .type-tile { padding: 14px; } .type-tile .muted { display: none; }
  .hero { padding: 48px 0 40px; }
  .hero-search { flex-wrap: wrap; border-radius: 18px; }
  .hero-search input { flex-basis: 100%; }
  .hero-search select { flex: 1; max-width: none; }
  .card-grid { grid-template-columns: 1fr; }
  .profile-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .profile-id h1 { margin-top: 0; }
  .profile-cta { width: 100%; } .profile-cta > .btn { flex: 1; }
  .cover { height: 160px; }
  .footer-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 22px; }
  .facts { grid-template-columns: 1fr; gap: 2px; } .facts dd { margin-bottom: 8px; }
  /* Mobile chat: full-screen single conversation */
  .chat-dock { right: 0; left: 0; top: 0; bottom: 0; flex-direction: column; justify-content: flex-end; }
  .chat-win { width: 100%; height: 100%; border-radius: 0; }
  .chat-win.minimized { display: none; }
  .chat-launcher { right: 14px; bottom: 14px; }
  body:has(.chat-dock .chat-win:not(.minimized)) .chat-launcher { display: none; }
  .chat-list-panel { position: fixed; inset: 0; width: auto; max-height: none; border-radius: 0; bottom: 0; }
  .inbox { grid-template-columns: 1fr; height: calc(100vh - 220px); }
  .inbox-thread { display: none; }
  .inbox.thread-open .inbox-list { display: none; }
  .inbox.thread-open .inbox-thread { display: flex; }
  .inbox-back { display: block; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 12px; text-align: left; font: inherit; font-weight: 600; color: var(--brand); cursor: pointer; }
  .table th, .table td { padding: 9px 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
