/* B2B Matchmaking — UI stylesheet */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --ink: #0f1a2e;
  --ink-2: #3b475e;
  --muted: #6b778c;
  --line: #e3e7ef;
  --brand: #1747d1;
  --brand-2: #0f33a0;
  --brand-soft: #e8eefe;
  --accent: #0fa37f;
  --accent-soft: #e2f6f0;
  --warn: #c7820a;
  --warn-soft: #fdf3dd;
  --danger: #d23b3b;
  --danger-soft: #fdeaea;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 26, 46, .05), 0 4px 16px rgba(15, 26, 46, .05);
  --shadow-lg: 0 10px 40px rgba(15, 26, 46, .12);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 2rem; } h2 { font-size: 1.45rem; } h3 { font-size: 1.1rem; } h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: 8px } .mt-2 { margin-top: 16px } .mt-3 { margin-top: 24px } .mt-4 { margin-top: 40px }
.mb-0 { margin-bottom: 0 } .mb-1 { margin-bottom: 8px } .mb-2 { margin-bottom: 16px } .mb-3 { margin-bottom: 24px }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.site-header .container { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); font-size: 1.05rem; letter-spacing: -.02em; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--brand), #3f7bff); display: grid; place-items: center; color: #fff; }
.logo-mark svg { width: 20px; height: 20px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: var(--ink-2); padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: .93rem; }
.nav a:hover, .nav a.active { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.menu-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--ink); }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--ink-2); }
.icon-btn:hover { background: var(--surface-2); text-decoration: none; }
.icon-btn .dot { position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.avatar { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-weight: 700; display: grid; place-items: center; font-size: .85rem; overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 72px; height: 72px; border-radius: 16px; font-size: 1.4rem; }
.avatar.md { width: 48px; height: 48px; border-radius: 12px; font-size: 1rem; }
.dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 220px; padding: 6px; z-index: 60; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); text-decoration: none; }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.dropdown-head { padding: 8px 12px; font-size: .85rem; color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; font: 600 .93rem var(--font); border: 1px solid transparent; cursor: pointer; background: var(--brand); color: #fff; white-space: nowrap; transition: background .15s, box-shadow .15s; }
.btn:hover { background: var(--brand-2); text-decoration: none; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-accent { background: var(--accent); } .btn-accent:hover { background: #0b8a6b; }
.btn-danger { background: var(--danger); } .btn-danger:hover { background: #b52f2f; }
.btn-light { background: #fff; color: var(--brand); } .btn-light:hover { background: #eef2ff; }
.btn-sm { padding: 6px 12px; font-size: .85rem; border-radius: 8px; }
.btn-lg { padding: 14px 24px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.link-btn { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; padding: 0; }
.link-btn:hover { text-decoration: underline; }
form.inline { display: inline; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 22px; }
.card-head { padding: 16px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-head h3, .card-head h2 { margin: 0; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.card + .card { margin-top: 20px; }
.grid > .card + .card, .grid > * > .card:first-child { margin-top: 0; }
.card-link { display: block; color: inherit; transition: box-shadow .15s, transform .15s; }
.card-link:hover { text-decoration: none; box-shadow: var(--shadow-lg); transform: translateY(-1px); }

/* Badges & tags */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge-brand { background: var(--brand-soft); color: var(--brand); }
.badge-green { background: var(--accent-soft); color: #08795d; }
.badge-warn { background: var(--warn-soft); color: #92600a; }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-dark { background: var(--ink); color: #fff; }
.verified { color: var(--accent); display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: .8rem; }
.verified svg { width: 16px; height: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: var(--surface-2); border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; font-size: .8rem; color: var(--ink-2); }

/* Score */
.score { display: inline-flex; align-items: center; justify-content: center; gap: 1px; width: 58px; height: 58px; border-radius: 50%; font-weight: 800; font-size: 1rem; position: relative; flex-shrink: 0; }
.score::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px)); }
.score small { font-size: .6rem; font-weight: 700; }
.score-high { --c: var(--accent); color: #08795d; }
.score-mid { --c: var(--brand); color: var(--brand); }
.score-low { --c: var(--warn); color: #92600a; }
.score-pill { font-weight: 700; padding: 3px 10px; border-radius: 999px; font-size: .8rem; }
.score-pill.score-high { background: var(--accent-soft); } .score-pill.score-mid { background: var(--brand-soft); } .score-pill.score-low { background: var(--warn-soft); }
.breakdown { display: grid; gap: 6px; font-size: .82rem; }
.breakdown .bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.breakdown .bar span { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.breakdown .line { display: grid; grid-template-columns: 150px 1fr 48px; gap: 10px; align-items: center; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.field label, .label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; color: var(--ink); }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.field-error { color: var(--danger); font-size: .8rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=tel], input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(23, 71, 209, .15); }
select[multiple] { min-height: 120px; }
select { max-width: 100%; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; font-size: .92rem; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--brand); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 16px; }
.choice-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.choice-cards label { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; cursor: pointer; font-weight: 600; font-size: .9rem; background: #fff; }
.choice-cards label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-2); }
.choice-cards input { accent-color: var(--brand); }
.form-section { padding: 24px 0; border-bottom: 1px solid var(--line); }
.form-section:first-child { padding-top: 0; }
.form-section:last-child { border-bottom: 0; }
.form-section h3 { margin-bottom: 4px; }
.form-section > p.muted { margin-bottom: 16px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 20px; }

/* Multi-select chips (enhanced by app.js) */
.ms { position: relative; }
.ms-box { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; min-height: 44px; cursor: text; align-items: center; }
.ms-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(23, 71, 209, .15); }
.ms-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--brand-soft); color: var(--brand-2); border-radius: 6px; padding: 3px 4px 3px 8px; font-size: .82rem; font-weight: 600; }
.ms-chip button { border: 0; background: none; cursor: pointer; color: inherit; font-size: 1rem; line-height: 1; padding: 0 3px; }
.ms-input { border: 0 !important; box-shadow: none !important; padding: 4px !important; flex: 1; min-width: 120px; width: auto !important; }
.ms-list { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); max-height: 260px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 40; padding: 4px; }
.ms.open .ms-list { display: block; }
.ms-opt { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: .9rem; }
.ms-opt:hover, .ms-opt.hl { background: var(--surface-2); }
.ms-opt.group { font-weight: 700; color: var(--brand); }
.ms-empty { padding: 8px 10px; color: var(--muted); font-size: .85rem; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; font-size: .93rem; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: var(--accent-soft); border-color: #bfe8dc; color: #06604a; }
.alert-error { background: var(--danger-soft); border-color: #f6c9c9; color: #9b2424; }
.alert-info { background: var(--brand-soft); border-color: #cdd9fb; color: var(--brand-2); }
.alert-warn { background: var(--warn-soft); border-color: #f3dfae; color: #7d5208; }
.flash-wrap { position: fixed; top: 76px; right: 20px; z-index: 100; width: min(420px, calc(100% - 40px)); }
.flash-wrap .alert { box-shadow: var(--shadow-lg); animation: slidein .25s ease-out; }
@keyframes slidein { from { transform: translateY(-8px); opacity: 0 } to { transform: none; opacity: 1 } }

/* Tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fafbfe; }

/* Hero & marketing */
.hero { background: radial-gradient(1200px 500px at 80% -10%, #3f7bff33, transparent), linear-gradient(180deg, #0c1a3d 0%, #13295e 100%); color: #fff; padding: 84px 0 96px; position: relative; overflow: hidden; }
.hero h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); font-weight: 800; letter-spacing: -.03em; max-width: 780px; }
.hero p.lead { font-size: 1.2rem; color: #c8d4f5; max-width: 640px; margin-bottom: 28px; }
.hero .eyebrow { display: inline-block; background: #ffffff1a; border: 1px solid #ffffff2a; color: #dbe5ff; padding: 5px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600; margin-bottom: 20px; }
.hero-grid > *, .layout-sidebar > *, .grid > * { min-width: 0; }
.show-sm { display: none; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero-card { background: #fff; color: var(--ink); border-radius: 16px; padding: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.hero-search { display: flex; gap: 8px; background: #fff; padding: 8px; border-radius: 14px; max-width: 620px; box-shadow: var(--shadow-lg); }
.hero-search input, .hero-search select { border: 0; box-shadow: none !important; }
.hero-search select { max-width: 190px; border-left: 1px solid var(--line); border-radius: 0; }
.hero-stats { display: flex; gap: 36px; margin-top: 36px; flex-wrap: wrap; }
.hero-stats strong { display: block; font-size: 1.6rem; }
.hero-stats span { color: #a9b8e6; font-size: .9rem; }
.section { padding: 72px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 680px; margin: 0 auto 40px; text-align: center; }
.section-head h2 { font-size: 2rem; letter-spacing: -.02em; }
.section-head p { color: var(--muted); font-size: 1.08rem; }
.kicker { color: var(--brand); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; display: block; }
.feature { padding: 24px; }
.feature .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 14px; }
.feature .ic svg { width: 22px; height: 22px; }
.feature p { color: var(--muted); margin: 0; }
.steps { counter-reset: s; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.step { position: relative; padding: 22px; }
.step::before { counter-increment: s; content: counter(s); width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; display: grid; place-items: center; margin-bottom: 12px; }
.step p { color: var(--muted); margin: 0; font-size: .92rem; }
.compare { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.compare .card-body h3 { display: flex; gap: 8px; align-items: center; }
.cta-band { background: linear-gradient(120deg, var(--brand), #3f7bff); color: #fff; border-radius: 20px; padding: 48px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.cta-band h2 { font-size: 1.8rem; margin: 0 0 6px; }
.cta-band p { margin: 0; color: #dfe7ff; }
.match-demo { display: flex; align-items: center; gap: 14px; }
.match-demo .co { flex: 1; background: var(--surface-2); border-radius: 12px; padding: 12px; font-size: .85rem; }
.match-demo .co strong { display: block; font-size: .92rem; }

/* Pricing */
.pricing { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; align-items: stretch; }
.plan { display: flex; flex-direction: column; padding: 26px; position: relative; }
.plan.popular { border: 2px solid var(--brand); box-shadow: var(--shadow-lg); }
.plan .ribbon { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--brand); color: #fff; font-size: .75rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.plan .price { font-size: 2.3rem; font-weight: 800; letter-spacing: -.03em; margin: 8px 0 0; }
.plan .price small { font-size: .9rem; color: var(--muted); font-weight: 500; }
.plan ul { list-style: none; padding: 0; margin: 20px 0 24px; flex: 1; }
.plan li { padding: 6px 0 6px 26px; position: relative; font-size: .92rem; }
.plan li::before { content: ""; position: absolute; left: 0; top: 10px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%230fa37f'%3E%3Cpath d='M8.2 13.6 4.6 10l-1.2 1.2 4.8 4.8L17 7.2 15.8 6z'/%3E%3C/svg%3E") center/12px no-repeat; }
.plan.current { outline: 2px solid var(--accent); }

/* Directory & listing */
.page-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 32px 0 28px; }
.page-head h1 { margin-bottom: 4px; }
.page-head p { color: var(--muted); margin: 0; }
.layout-sidebar { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; padding: 28px 0 60px; }
.filters { position: sticky; top: 84px; align-self: start; }
.filters .field { margin-bottom: 14px; }
.filters h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 10px; }
.locked { position: relative; opacity: .55; pointer-events: none; }
.lock-note { font-size: .8rem; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.company-card { display: flex; gap: 16px; padding: 20px; }
.company-card h3 { margin: 0 0 2px; font-size: 1.05rem; }
.company-card h3 a { color: var(--ink); }
.company-card .meta { color: var(--muted); font-size: .85rem; display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.company-card p { color: var(--ink-2); font-size: .92rem; margin-bottom: 10px; }
.list > .card { margin-bottom: 14px; }
.results-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 38px; height: 38px; display: grid; place-items: center; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: .9rem; }
.pager .current { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager a:hover { text-decoration: none; background: var(--surface-2); }
.empty { text-align: center; padding: 56px 24px; color: var(--muted); }
.empty .ic { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.empty h3 { color: var(--ink); }

/* Profile */
.profile-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 32px 0; }
.profile-head .row { align-items: flex-start; }
.profile-head h1 { margin-bottom: 6px; font-size: 1.8rem; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.blur { filter: blur(5px); user-select: none; }

/* Dashboard */
.dash { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 12px; position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; color: var(--ink-2); font-weight: 500; font-size: .92rem; margin-bottom: 2px; }
.sidebar a svg { width: 18px; height: 18px; opacity: .75; flex-shrink: 0; }
.sidebar a:hover { background: var(--surface-2); text-decoration: none; }
.sidebar a.active { background: var(--brand-soft); color: var(--brand-2); font-weight: 600; }
.sidebar a.active svg { opacity: 1; }
.sidebar .count { margin-left: auto; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.sidebar .sec { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 16px 12px 6px; }
.sidebar .plan-box { margin: 20px 4px 0; padding: 14px; border-radius: 12px; background: var(--surface-2); font-size: .85rem; }
.sidebar .plan-box a { display: inline; padding: 0; margin: 0; color: var(--brand); font-weight: 600; font-size: .85rem; }
.sidebar .plan-box a:hover { background: none; text-decoration: underline; }
.main { padding: 28px 32px 60px; min-width: 0; }
.main-head > * { max-width: 100%; }
.main-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.main-head h1 { font-size: 1.6rem; margin: 0 0 4px; }
.main-head p { margin: 0; color: var(--muted); }
.stat { padding: 18px 20px; }
.stat .label { color: var(--muted); font-size: .82rem; font-weight: 600; margin: 0; }
.stat .value { font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.stat .sub { font-size: .8rem; color: var(--muted); }
.stat.hl { background: linear-gradient(135deg, var(--brand), #3f7bff); color: #fff; border: 0; }
.stat.hl .label, .stat.hl .sub { color: #dbe5ff; }
.progress { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); }
.list-item { display: flex; gap: 14px; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; color: var(--ink); }
.list-item .sub { font-size: .84rem; color: var(--muted); }
.unread { background: #f7f9ff; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(170px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 10px; }
.kanban-col { background: var(--surface-2); border-radius: 12px; padding: 12px; min-height: 280px; }
.kanban-col h4 { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: 12px; }
.kanban-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; font-size: .85rem; box-shadow: var(--shadow); }
.kanban-card strong { display: block; font-size: .92rem; margin-bottom: 2px; }
.kanban-card select { padding: 5px 8px; font-size: .8rem; margin-top: 8px; }
.stage-won h4 { color: var(--accent); } .stage-lost h4 { color: var(--danger); }

/* Chat */
.chat { display: flex; flex-direction: column; height: calc(100vh - 230px); min-height: 420px; }
.chat-log { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 72%; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); font-size: .93rem; }
.bubble.me { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.bubble.them { align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.system { align-self: center; background: var(--warn-soft); color: #7d5208; font-size: .82rem; max-width: 90%; text-align: center; }
.bubble .time { font-size: .7rem; opacity: .7; margin-top: 4px; }
.chat-form { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); }
.chat-form textarea { min-height: 46px; height: 46px; }

/* Charts */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.bars .b { flex: 1; background: var(--brand-soft); border-radius: 6px 6px 0 0; position: relative; min-height: 2px; }
.bars .b span { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: .7rem; color: var(--muted); padding-bottom: 2px; }
.bars .b.cur { background: var(--brand); }
.bars-x { display: flex; gap: 6px; font-size: .7rem; color: var(--muted); margin-top: 6px; }
.bars-x span { flex: 1; text-align: center; }
.funnel .f { display: grid; grid-template-columns: 140px 1fr 50px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: .88rem; }
.funnel .f .bar { height: 22px; background: var(--brand-soft); border-radius: 6px; overflow: hidden; }
.funnel .f .bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #3f7bff); }

/* Footer */
.site-footer { background: #0c1a3d; color: #a9b8e6; padding: 56px 0 28px; margin-top: 0; }
.site-footer a { color: #dbe5ff; }
.site-footer h4 { color: #fff; font-size: .9rem; margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer-bottom { border-top: 1px solid #ffffff1a; margin-top: 40px; padding-top: 20px; font-size: .85rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.site-footer .logo { color: #fff; }

/* Auth */
.auth-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 460px; }
.auth-card.wide { max-width: 720px; }
.auth-card h1 { font-size: 1.6rem; }
.divider { text-align: center; color: var(--muted); font-size: .85rem; margin: 18px 0; }

/* Upgrade prompt */
.upsell { border: 1px dashed #b9c8f6; background: #f5f8ff; border-radius: 12px; padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.upsell strong { color: var(--brand-2); }

.prose { font-size: 1rem; line-height: 1.7; }
.prose h2 { margin-top: 1.6em; } .prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.prose td, .prose th { border: 1px solid var(--line); padding: 8px 10px; }

/* Responsive */
@media (max-width: 1080px) {
  .pricing { grid-template-columns: repeat(2, 1fr); }
  .kanban { grid-template-columns: repeat(6, 220px); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--surface); flex-direction: column; padding: 12px 20px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg); }
  .nav.open { display: flex; }
  .menu-toggle { display: block; }
  .site-header .container { gap: 12px; }
  .header-actions .hide-sm { display: none; }
  .hero-grid, .layout-sidebar, .grid-2, .grid-3, .compare, .footer-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .filters { position: static; }
  .dash { grid-template-columns: minmax(0, 1fr); }
  .dash > * { min-width: 0; }
  .grid[style], .layout-sidebar[style] { grid-template-columns: minmax(0, 1fr) !important; }
  .sidebar { position: static; height: auto; display: flex; overflow-x: auto; gap: 4px; padding: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .sec, .sidebar .plan-box { display: none; }
  .sidebar a { white-space: nowrap; margin: 0; }
  .main { padding: 20px 16px 48px; }
  .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
  .breakdown .line { grid-template-columns: 110px 1fr 40px; }
  .hero { padding: 56px 0 64px; }
  .hero-search { flex-direction: column; }
  .hero-search select { max-width: none; border-left: 0; border-top: 1px solid var(--line); }
  .cta-band { padding: 32px 24px; }
  .section { padding: 52px 0; }
}
@media (max-width: 560px) {
  .hide-sm { display: none !important; }
  .has-user .logo-text { display: none; }
  .show-sm { display: inline !important; }
  .header-actions .btn { padding: 8px 12px; }
  .hero-stats { gap: 20px; }
  .hero h1 { font-size: 2rem; }
  .pricing, .grid-4, .steps { grid-template-columns: 1fr; }
  h1 { font-size: 1.6rem; }
  .bubble { max-width: 88%; }
  .company-card { flex-direction: column; }
}
