/* ── Tokens ───────────────────────────────────────────────── */
:root {
  --blue: #0a66c2;
  --blue-dark: #004182;
  --blue-soft: #e8f0fe;
  --ink: rgba(0, 0, 0, 0.9);
  --ink-2: rgba(0, 0, 0, 0.6);
  --ink-3: rgba(0, 0, 0, 0.45);
  --line: rgba(0, 0, 0, 0.08);
  --bg: #f4f2ee;
  --card: #ffffff;
  --hover: rgba(0, 0, 0, 0.06);
  --green: #057642;
  --radius: 8px;
  --shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.06);
  --nav-h: 52px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.42857 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, li, figure { margin: 0; padding: 0; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.sprite { display: none; }
.ic { width: 24px; height: 24px; fill: currentColor; flex: none; }
.ic--photo { color: #378fe9; }
.ic--video { color: #5f9b3f; }
.ic--event { color: #c37d16; }
.ic--article { color: #e16745; }

/* ── Avatars ──────────────────────────────────────────────── */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; flex: none; color: #fff; font-weight: 600;
  letter-spacing: 0.02em; background: linear-gradient(135deg, var(--g1), var(--g2));
  user-select: none;
}
.avatar--xs { width: 24px; height: 24px; font-size: 9px; }
.avatar--sm { width: 32px; height: 32px; font-size: 11px; }
.avatar--md { width: 48px; height: 48px; font-size: 16px; }
.avatar--lg { width: 72px; height: 72px; font-size: 24px; }
.avatar--xl { width: 104px; height: 104px; font-size: 34px; }

/* ── Global nav ───────────────────────────────────────────── */
.gnav {
  position: sticky; top: 0; z-index: 60;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.gnav__inner {
  max-width: 1128px; margin: 0 auto; height: var(--nav-h);
  display: flex; align-items: center; gap: 8px; padding: 0 16px;
}
.gnav__logo {
  width: 34px; height: 34px; border-radius: 4px; background: var(--blue);
  display: grid; place-items: center; text-decoration: none; flex: none;
}
.gnav__logo span { color: #fff; font-weight: 700; font-size: 19px; letter-spacing: -0.5px; }
.gnav__search { position: relative; flex: 0 1 280px; margin-left: 4px; }
.gnav__search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-2); }
.gnav__search input {
  width: 100%; height: 34px; padding: 0 12px 0 36px; font: inherit;
  border: 1px solid transparent; border-radius: 4px; background: #edf3f8; color: var(--ink);
}
.gnav__search input::placeholder { color: var(--ink-2); }
.gnav__search input:focus { outline: 2px solid var(--blue); background: #fff; }

.gnav__links { display: flex; align-items: stretch; margin-left: auto; height: var(--nav-h); }
.gnav__item {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-width: 78px; padding: 0 6px; color: var(--ink-2); font-size: 12px; line-height: 1.2;
  border-bottom: 2px solid transparent; transition: color .12s;
}
.gnav__item .ic { width: 22px; height: 22px; }
.gnav__item:hover { color: var(--ink); }
.gnav__item.is-active { color: var(--ink); border-bottom-color: var(--ink); }
.gnav__item .badge {
  position: absolute; top: 4px; left: 50%; margin-left: 2px;
  background: #cb112d; color: #fff; font-style: normal; font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px;
  display: grid; place-items: center; border: 2px solid var(--card);
}
.gnav__item--me span:last-child { white-space: nowrap; }

.gnav__aside { display: flex; align-items: center; gap: 8px; padding-left: 8px; border-left: 1px solid var(--line); margin-left: 8px; }
.gnav__pill {
  max-width: 130px; padding: 6px 12px; border-radius: 16px; color: #915907;
  font-size: 12px; font-weight: 600; text-align: center; line-height: 1.25;
}
.gnav__pill:hover { background: var(--hover); }
.gnav__grid { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--ink-2); }
.gnav__grid:hover { background: var(--hover); color: var(--ink); }

/* ── Layout shell ─────────────────────────────────────────── */
.shell {
  max-width: 1128px; margin: 0 auto; padding: 24px 16px 48px;
  display: grid; grid-template-columns: 225px minmax(0, 1fr) 300px; gap: 24px;
  align-items: start;
}
.col--center { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rail { display: flex; flex-direction: column; gap: 8px; position: sticky; top: calc(var(--nav-h) + 24px); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card__head {
  display: flex; align-items: baseline; gap: 8px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.card__head--flush { border-bottom: 0; padding-bottom: 4px; }
.card__head h2 { font-size: 16px; font-weight: 600; }
.card__head small { color: var(--ink-2); font-size: 12px; }
.card__count { margin-left: auto; color: var(--blue); font-weight: 600; }
.card__link { margin-left: auto; color: var(--blue); font-weight: 600; font-size: 14px; }

/* ── Profile card (left) ──────────────────────────────────── */
.profile__banner, .profile-hero {
  height: 56px;
  background: linear-gradient(120deg, #1f4fa8, #4b8bf5 45%, #7db4ff);
}
.profile-hero { height: 176px; background: linear-gradient(120deg, #16336b, #2f6bd0 40%, #79b0ff 100%); }
.profile__body { padding: 0 12px 16px; text-align: center; }
.profile__avatar { margin-top: -36px; border: 2px solid #fff; }
.profile__name { font-size: 16px; font-weight: 600; margin-top: 8px; }
.profile__headline { color: var(--ink-2); font-size: 12px; margin-top: 4px; }
.profile__meta { color: var(--ink-3); font-size: 12px; margin-top: 4px; }
.profile__link { font-size: 12px; margin-top: 8px; }
.profile__link strong { color: var(--blue); }
.profile__stats { display: grid; gap: 6px; margin: 14px 0; text-align: left; }
.profile__stats > div { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); }
.profile__stats > div:hover { color: var(--blue); cursor: pointer; }
.profile__stat-n { font-weight: 700; color: var(--blue); }

.profile-full { padding: 0 24px 24px; }
.profile-full .avatar { margin-top: -60px; border: 3px solid #fff; }
.profile-full .profile__name { font-size: 24px; }
.profile-full .profile__headline { font-size: 16px; }
.profile-full .profile__meta, .profile-full .profile__link { font-size: 14px; }
.profile__cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 16px; border-radius: 16px; font-weight: 600; font-size: 14px;
  transition: background .12s, color .12s, box-shadow .12s;
}
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-dark); }
.btn--outline { box-shadow: inset 0 0 0 1px var(--blue); color: var(--blue); }
.btn--outline:hover { background: var(--blue-soft); box-shadow: inset 0 0 0 2px var(--blue); }
.btn--ghost { box-shadow: inset 0 0 0 1px rgba(0,0,0,.35); color: var(--ink-2); }
.btn--ghost:hover { background: var(--hover); box-shadow: inset 0 0 0 2px rgba(0,0,0,.5); }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }

/* ── Left rail menu ───────────────────────────────────────── */
.menu li button {
  display: flex; justify-content: space-between; width: 100%;
  padding: 8px 12px; font-size: 12px; font-weight: 600; color: var(--ink-2);
}
.menu li button:hover { background: var(--hover); color: var(--ink); }
.menu li b { font-weight: 600; color: var(--ink-2); }
.menu__discover { width: 100%; padding: 10px; font-size: 12px; font-weight: 600; color: var(--ink-2); border-top: 1px solid var(--line); }
.menu__discover:hover { background: var(--hover); color: var(--ink); }

/* ── Composer ─────────────────────────────────────────────── */
.composer { padding: 12px 16px; }
.composer__top { display: flex; align-items: center; gap: 8px; }
.composer__fake {
  flex: 1; text-align: left; height: 48px; padding: 0 16px; border-radius: 24px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); color: var(--ink-2); font-weight: 600;
}
.composer__fake:hover { background: var(--hover); }
.composer__box { padding-top: 12px; }
.composer__box textarea {
  width: 100%; padding: 10px 12px; font: inherit; resize: vertical;
  border: 1px solid var(--line); border-radius: var(--radius); outline-offset: 1px;
}
.composer__actions { display: flex; gap: 8px; margin-top: 10px; }
.composer__bar { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px;
  border-radius: 4px; color: var(--ink-2); font-size: 14px; font-weight: 600;
}
.chip:hover { background: var(--hover); color: var(--ink); }
.chip .ic { width: 20px; height: 20px; }

.divider { display: flex; align-items: center; gap: 8px; padding: 0 4px; }
.divider span { flex: 1; height: 1px; background: var(--line); }
.divider p { font-size: 12px; color: var(--ink-2); }

/* ── Feed / posts ─────────────────────────────────────────── */
.feed { display: flex; flex-direction: column; gap: 8px; }
.post__head { display: flex; gap: 8px; padding: 12px 16px 0; }
.post__who { min-width: 0; }
.post__name { font-size: 14px; font-weight: 600; }
.post__name a { color: var(--ink); }
.post__name a:hover { color: var(--blue); }
.post__sub { color: var(--ink-2); font-size: 12px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.post__sub .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; display: inline-block; }
.post__more { margin-left: auto; color: var(--ink-2); padding: 4px; border-radius: 50%; }
.post__more:hover { background: var(--hover); }
.post__text { padding: 8px 16px 12px; white-space: pre-wrap; font-size: 14px; }
.post__media { padding: 0 16px 12px; }
.post__figure {
  height: 260px; border-radius: 4px; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 20px; letter-spacing: .04em; text-align: center; padding: 24px;
}
.post__caption { color: var(--ink-2); font-size: 12px; padding-top: 8px; }
.post__social { display: flex; align-items: center; gap: 6px; padding: 8px 16px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }
.post__social .likes { display: flex; align-items: center; gap: 4px; }
.post__social .likes .em { font-size: 13px; }
.post__social .count { margin-left: auto; display: flex; gap: 10px; }
.post__social .count button:hover { color: var(--blue); text-decoration: underline; }
.post__actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; gap: 2px; }
.post__action {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; border-radius: 4px; color: var(--ink-2); font-weight: 600; font-size: 14px;
}
.post__action .ic { width: 20px; height: 20px; }
.post__action:hover { background: var(--hover); color: var(--ink); }
.post__action.is-on { color: var(--blue); }
.post__action.is-on .ic { fill: var(--blue); }
.post__comments { padding: 8px 16px 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.comment { display: flex; gap: 8px; }
.comment__bubble { background: #f2f2f2; border-radius: 0 8px 8px 8px; padding: 8px 12px; min-width: 0; }
.comment__bubble h4 { font-size: 13px; font-weight: 600; }
.comment__bubble p { font-size: 13px; color: var(--ink); margin-top: 2px; word-wrap: break-word; }
.comment__bubble small { display: block; font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.comment__write { display: flex; gap: 8px; align-items: center; }
.comment__write input {
  flex: 1; height: 36px; padding: 0 14px; border-radius: 18px; font: inherit;
  border: 1px solid var(--line); background: #fff;
}
.comment__write input:focus { outline: 2px solid var(--blue); outline-offset: 0; }

/* ── Right rail ───────────────────────────────────────────── */
.news li { padding: 6px 16px; }
.news li button { display: flex; gap: 10px; width: 100%; text-align: left; }
.news li button:hover .news__title { color: var(--blue); }
.news__n { font-weight: 700; color: var(--ink); font-size: 14px; }
.news__title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.news__meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.follow li { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.follow__body { min-width: 0; flex: 1; }
.follow__body h3 { font-size: 14px; font-weight: 600; }
.follow__body p { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.follow__body .btn { margin-top: 8px; }
.follow .avatar { width: 48px; height: 48px; border-radius: 50%; }
.follow .sq { width: 48px; height: 48px; border-radius: 4px; }

.card--puzzle { padding: 16px; }
.card--puzzle h2 { font-size: 14px; font-weight: 600; }
.card--puzzle p { font-size: 12px; color: var(--ink-2); margin: 4px 0 12px; }
.puzzle__row { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }
.puzzle__tile {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 4px;
  background: var(--blue-soft); color: var(--blue-dark); font-weight: 700;
}
.rail__footer { padding: 0 0 16px; }
.rail__footer ul { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; }
.rail__footer a { color: var(--ink-3); font-size: 12px; }
.rail__footer a:hover { color: var(--blue); }
.rail__brand { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 14px; color: var(--ink-3); font-size: 12px; }
.rail__brand span { background: var(--blue); color: #fff; font-weight: 700; border-radius: 3px; padding: 1px 5px; font-size: 13px; }

/* ── Network ──────────────────────────────────────────────── */
.invites { padding: 8px 0; }
.invites li { display: flex; gap: 8px; padding: 12px 16px; align-items: center; }
.invites li + li { border-top: 1px solid var(--line); }
.invites__body { flex: 1; min-width: 0; }
.invites__body h3 { font-size: 14px; font-weight: 600; }
.invites__body p { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.invites__cta { display: flex; gap: 8px; margin-top: 8px; }
.invites .avatar { width: 56px; height: 56px; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; padding: 16px; }
.person { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-align: center; }
.person__banner { height: 48px; background: linear-gradient(120deg, #2f6bd0, #79b0ff); }
.person__body { padding: 0 12px 14px; }
.person .avatar { margin-top: -24px; border: 2px solid #fff; }
.person h3 { font-size: 14px; font-weight: 600; margin-top: 8px; }
.person p { font-size: 12px; color: var(--ink-2); margin: 4px 0 12px; min-height: 32px; }

/* ── Jobs ─────────────────────────────────────────────────── */
.jobs { padding: 4px 0; }
.jobs li { display: flex; gap: 12px; padding: 14px 16px; }
.jobs li + li { border-top: 1px solid var(--line); }
.jobs__logo { width: 56px; height: 56px; border-radius: 4px; display: grid; place-items: center; color: #fff; font-weight: 700; flex: none; }
.jobs__body { flex: 1; min-width: 0; }
.jobs__body h3 { font-size: 15px; font-weight: 600; color: var(--blue); }
.jobs__body p { font-size: 13px; margin-top: 2px; }
.jobs__body small { display: block; font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.jobs__badges { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: #eef3f8; color: var(--ink-2); }
.tag--green { background: #e6f4ea; color: var(--green); }

/* ── Messaging ────────────────────────────────────────────── */
.messaging { display: grid; grid-template-columns: 300px 1fr; min-height: 520px; }
.messaging__list { border-right: 1px solid var(--line); }
.messaging__list ul li button {
  display: flex; gap: 10px; width: 100%; padding: 12px; text-align: left; border-bottom: 1px solid var(--line);
}
.messaging__list ul li button:hover { background: var(--hover); }
.messaging__list li.is-active button { background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--blue); }
.thread__body { min-width: 0; flex: 1; }
.thread__top { display: flex; gap: 6px; align-items: baseline; }
.thread__top h3 { font-size: 14px; font-weight: 600; }
.thread__top small { color: var(--ink-3); font-size: 11px; margin-left: auto; }
.thread__body p { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.messaging__pane { display: flex; flex-direction: column; min-width: 0; }
.chat__head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat__head h3 { font-size: 15px; font-weight: 600; }
.chat__head p { font-size: 12px; color: var(--ink-2); }
.chat__body { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; background: #fff; }
.msg { display: flex; gap: 8px; max-width: 78%; }
.msg--me { margin-left: auto; flex-direction: row-reverse; }
.msg__bubble { border-radius: 12px; padding: 8px 12px; font-size: 14px; background: #f2f2f2; }
.msg--me .msg__bubble { background: var(--blue-soft); }
.msg small { display: block; font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.chat__form { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.chat__form input { flex: 1; height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line); font: inherit; }
.chat__form input:focus { outline: 2px solid var(--blue); }

/* ── Notifications ────────────────────────────────────────── */
.notifs li { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notifs li.is-new { background: #eef4fb; }
.notifs li:hover { background: var(--hover); }
.notifs__body { min-width: 0; flex: 1; }
.notifs__body p { font-size: 14px; }
.notifs__body small { font-size: 12px; color: var(--ink-2); }
.notifs__thumb { width: 56px; height: 56px; border-radius: 4px; flex: none; background: linear-gradient(135deg, #2f6bd0, #79b0ff); }
.notifs .ic-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); align-self: center; flex: none; }

/* ── Profile panel ────────────────────────────────────────── */
.analytics li { display: grid; grid-template-columns: 24px 1fr; gap: 4px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.analytics li .ic { grid-row: span 2; color: var(--ink-2); }
.analytics li span { font-size: 14px; font-weight: 600; }
.analytics li small { grid-column: 2; font-size: 12px; color: var(--ink-2); }
.analytics li:hover { background: var(--hover); cursor: pointer; }
.exp li { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.exp li h3 { font-size: 14px; font-weight: 600; }
.exp li p { font-size: 13px; }
.exp li small { font-size: 12px; color: var(--ink-2); }
.sq { width: 48px; height: 48px; border-radius: 4px; display: grid; place-items: center; flex: none; }
.sq--a { background: linear-gradient(135deg, #1f4fa8, #4b8bf5); }
.sq--b { background: linear-gradient(135deg, #057642, #35a06a); }
.sq--c { background: linear-gradient(135deg, #915907, #d69a2f); }

/* ── Panels ───────────────────────────────────────────────── */
.panel { display: none; }
.panel.is-open { display: flex; flex-direction: column; gap: 8px; }

/* ── Toast ────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px);
  background: #1b1f23; color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25);
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 100;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1080px) {
  .shell { grid-template-columns: 225px minmax(0, 1fr); }
  .rail--right { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail--left { display: none; }
  .gnav__search { flex: 1 1 auto; }
  .gnav__pill, .gnav__grid { display: none; }
  .gnav__item { min-width: 56px; }
  .gnav__item span:last-child { display: none; }
  .gnav__item--me span:last-child { display: none; }
  .messaging { grid-template-columns: 1fr; }
  .messaging__list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 220px; overflow-y: auto; }
  .profile-hero { height: 120px; }
}
@media (max-width: 560px) {
  .shell { padding: 12px 8px 40px; }
  .post__figure { height: 180px; }
}
@media (min-width: 861px) {
  .gnav__item span:last-child { display: block; }
  .gnav__item--me span:last-child { display: block; }
}
