/* Hirey LinkedIn — visual language modeled on LinkedIn (blue #0a66c2, warm feed bg). */
:root {
  --blue: #0a66c2;
  --blue-dark: #004182;
  --blue-hover: #ebf4fd;
  --bg: #f4f2ee;
  --card: #ffffff;
  --line: #e8e6e1;
  --ink: rgba(0, 0, 0, 0.9);
  --ink-2: rgba(0, 0, 0, 0.6);
  --ink-3: rgba(0, 0, 0, 0.45);
  --green: #057642;
  --shadow: 0 0 0 1px rgba(0,0,0,.08), 0 2px 3px rgba(0,0,0,.06);
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  height: 52px;
}
.topbar-inner {
  max-width: 1128px; margin: 0 auto; height: 52px;
  display: flex; align-items: center; gap: 8px; padding: 0 16px;
}
.brand-logo {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--blue); color: #fff; font-weight: 800; font-size: 16px; letter-spacing: -.5px;
}
.searchbox {
  display: flex; align-items: center; gap: 8px;
  background: #edf3f8; border-radius: 6px; padding: 0 10px; height: 34px;
  width: 280px; color: var(--ink-2);
}
.searchbox input { border: 0; background: transparent; outline: none; width: 100%; font-size: 14px; color: var(--ink); }
.ico { width: 18px; height: 18px; flex: none; }

.navlinks { margin-left: auto; display: flex; align-items: stretch; height: 52px; }
.navlinks a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; min-width: 76px; color: var(--ink-3); font-size: 12px;
  border-bottom: 2px solid transparent;
}
.navlinks a:hover { color: var(--ink); }
.navlinks a.active { color: var(--ink); border-bottom-color: var(--ink); }
.navlinks .ico { width: 22px; height: 22px; }
.nav-avatar {
  width: 24px; height: 24px; border-radius: 50%; background: var(--blue);
  color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center;
}

/* ---------------------------------------------------------------- layout */
.container { max-width: 1128px; margin: 24px auto; padding: 0 16px; }
.grid-3 { display: grid; grid-template-columns: 225px minmax(0,1fr) 300px; gap: 24px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 24px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 8px; }
.sticky { position: sticky; top: 70px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.card .pad { padding: 16px; }
.muted { color: var(--ink-2); }
.tiny { font-size: 12px; }
.loading { padding: 64px; text-align: center; color: var(--ink-2); }

/* ---------------------------------------------------------------- profile rail */
.profile-card .cover { height: 56px; background: linear-gradient(120deg, #a0b4cc, #cfd9e6); }
.profile-card .body { padding: 0 12px 16px; text-align: center; }
.profile-card .avatar { margin: -32px auto 8px; border: 2px solid #fff; }
.profile-card h2 { margin: 4px 0 2px; font-size: 16px; }
.rail-stat {
  display: flex; justify-content: space-between; padding: 10px 12px;
  border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-2);
}
.rail-stat b { color: var(--blue); }
.rail-link { display: block; padding: 12px; font-weight: 600; font-size: 13px; border-top: 1px solid var(--line); }
.rail-link:hover { background: #f3f6f8; }

/* avatars */
.avatar {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 700;
}
.avatar.sm { width: 40px; height: 40px; font-size: 14px; }
.avatar.lg { width: 72px; height: 72px; font-size: 26px; }
.avatar.xl { width: 120px; height: 120px; font-size: 42px; }

/* ---------------------------------------------------------------- composer */
.composer { display: flex; gap: 8px; align-items: center; padding: 14px 16px; }
.composer button {
  flex: 1; text-align: left; background: #fff; border: 1px solid #b0b0b0;
  border-radius: 30px; padding: 12px 16px; color: var(--ink-2); font-weight: 600; font-size: 14px;
}
.composer button:hover { background: #f3f6f8; }

.feed-divider { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 12px; margin: 12px 4px; }
.feed-divider::before, .feed-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------------------------------------------------------------- post card */
.post { margin-bottom: 8px; }
.post .head { display: flex; gap: 10px; padding: 12px 16px 4px; }
.post .head .meta { min-width: 0; }
.post .head .name { font-weight: 600; font-size: 14px; }
.post .head .name a:hover { color: var(--blue); text-decoration: underline; }
.post .head .sub { color: var(--ink-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post .pill {
  display: inline-block; margin: 2px 16px 0; padding: 2px 8px; border-radius: 4px;
  background: #eef3f8; color: var(--blue-dark); font-size: 11px; font-weight: 600;
}
.post .text { padding: 6px 16px 14px; white-space: pre-wrap; word-break: break-word; }
.post .actions { display: flex; border-top: 1px solid var(--line); }
.post .actions button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: none; border: 0; padding: 11px 4px; color: var(--ink-2); font-weight: 600; font-size: 13px;
}
.post .actions button:hover { background: #f3f6f8; border-radius: 4px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 24px; padding: 6px 16px; font-weight: 600; font-size: 14px; border: 1px solid transparent;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-outline { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn-outline:hover { background: var(--blue-hover); border-color: var(--blue-dark); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: #b0b0b0; }
.btn-ghost:hover { background: #f3f6f8; }
.btn-sm { padding: 4px 14px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------------------------------------------------------------- people grid */
.section-head { display: flex; align-items: baseline; justify-content: space-between; padding: 16px 16px 4px; }
.section-head h2 { font-size: 18px; margin: 0; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; padding: 12px 16px 16px; }
.person {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; text-align: center;
  display: flex; flex-direction: column;
}
.person .ptop { height: 54px; background: linear-gradient(120deg, #c4d0de, #e3e9f0); }
.person .pbody { padding: 0 12px 14px; flex: 1; display: flex; flex-direction: column; }
.person .avatar { margin: -28px auto 8px; border: 2px solid #fff; }
.person .name { font-weight: 600; font-size: 15px; }
.person .head-l { color: var(--ink-2); font-size: 12px; min-height: 32px; margin: 2px 0 4px; }
.person .loc { color: var(--ink-3); font-size: 12px; margin-bottom: 12px; }
.person .why { color: var(--ink-3); font-size: 11px; margin-bottom: 10px; }
.person .btn { width: 100%; margin-top: auto; }

/* ---------------------------------------------------------------- profile page */
.hero .cover { height: 140px; background: linear-gradient(120deg, #88a0bd, #cdd8e6); }
.hero .hbody { padding: 0 24px 20px; }
.hero .avatar { margin: -60px 0 8px; border: 4px solid #fff; }
.hero h1 { margin: 4px 0 2px; font-size: 24px; }
.hero .h-headline { font-size: 16px; }
.hero .h-loc { color: var(--ink-2); font-size: 14px; margin-top: 4px; }
.hero .h-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.about p { white-space: pre-wrap; color: var(--ink); margin: 8px 0 0; }
.listing-row { display: flex; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); }
.listing-row .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--blue); }
.listing-row .lt { font-size: 12px; color: var(--ink-3); }

/* ---------------------------------------------------------------- messaging */
.msg-wrap { display: grid; grid-template-columns: 320px 1fr; min-height: 540px; }
.thread-list { border-right: 1px solid var(--line); overflow-y: auto; max-height: 70vh; }
.thread-item { display: flex; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.thread-item:hover, .thread-item.active { background: #eef3f8; }
.thread-item .name { font-weight: 600; }
.thread-pane { display: flex; flex-direction: column; }
.bubbles { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: 60vh; }
.bubble { max-width: 70%; padding: 8px 12px; border-radius: 12px; font-size: 13px; }
.bubble.me { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 3px; }
.bubble.them { align-self: flex-start; background: #eef3f8; border-bottom-left-radius: 3px; }
.bubble .who { font-size: 10px; opacity: .7; margin-bottom: 2px; }

/* ---------------------------------------------------------------- right rail */
.news h3 { font-size: 16px; margin: 0; padding: 12px 16px 4px; }
.news li { list-style: none; padding: 6px 16px; }
.news .nt { font-weight: 600; font-size: 13px; }
.news .nd { color: var(--ink-3); font-size: 12px; }
.news ul { margin: 0; padding: 0 0 12px; }

/* empty states */
.empty { text-align: center; padding: 48px 24px; color: var(--ink-2); }
.empty .big { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }

/* search header */
.search-head { padding: 14px 16px; font-size: 15px; }
.search-head b { color: var(--ink); }
.tabs { display: flex; gap: 6px; padding: 0 16px 12px; }
.tab { padding: 6px 14px; border-radius: 18px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.tab.active { background: #084e8e; color: #fff; border-color: #084e8e; }

/* ---------------------------------------------------------------- modal + toast */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: grid; place-items: center; z-index: 200; }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(520px, 92vw); background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 16px 48px rgba(0,0,0,.3); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 18px; }
.icon-btn { background: none; border: 0; font-size: 24px; line-height: 1; color: var(--ink-2); }
.modal-body { padding: 16px; }
.modal-body .who { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.modal-body textarea {
  width: 100%; min-height: 110px; border: 1px solid #b0b0b0; border-radius: 8px; padding: 10px;
  font-family: inherit; font-size: 14px; resize: vertical;
}
.modal-body .row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* login modal */
.login-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.login-tab { flex: 1; padding: 8px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.login-tab.active { background: #eef3f8; color: var(--blue-dark); border-color: var(--blue); }
.login-input { width: 100%; border: 1px solid #b0b0b0; border-radius: 8px; padding: 11px 12px; font-family: inherit; font-size: 15px; margin-bottom: 10px; }
.btn-block { width: 100%; }
.login-status { margin-top: 10px; min-height: 18px; line-height: 1.5; }
.login-status a { color: var(--blue); font-weight: 600; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1d2226; color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 300;
  box-shadow: 0 8px 24px rgba(0,0,0,.3); font-size: 14px;
}
.toast[hidden] { display: none; }
.toast.err { background: #b42318; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 980px) { .grid-3 { grid-template-columns: minmax(0,1fr) 300px; } .grid-3 > .col:first-child { display: none; } }
@media (max-width: 740px) {
  body { overflow-x: hidden; }
  .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .composer button { min-width: 0; white-space: normal; }
  .grid-3 > .col:first-child, .grid-2 > .col:last-child, .grid-3 > .col:last-child { display: none; }
  .searchbox { width: 160px; }
  .navlinks a span:not(.nav-avatar) { display: none; }
  .navlinks a { min-width: 52px; }
  .msg-wrap { grid-template-columns: 1fr; }
}
