*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --blue-primary: #0a66c2;
  --blue-dark: #004182;
  --blue-light: #e8f0fe;
  --bg: #f4f2ee;
  --card-bg: #ffffff;
  --text-primary: #191919;
  --text-secondary: #666666;
  --border: #e0dfdc;
  --success: #057642;
  --error: #cc1016;
  --radius: 8px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

/* ---- Topbar ---- */

.topbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-inner {
  max-width: 1128px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-svg {
  width: 34px;
  height: 34px;
}

.logo-text {
  font-weight: 700;
  font-size: 20px;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---- Notifications ---- */

.notif-wrapper {
  position: relative;
}

.notif-bell {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  padding: 4px 8px;
  position: relative;
  line-height: 1;
}

.bell-icon {
  display: inline-block;
}

.notif-badge {
  display: none;
  position: absolute;
  top: 0;
  right: 2px;
  background: #cc1016;
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.notif-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 200;
}

.notif-dropdown.open {
  display: block;
}

.notif-item {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  line-height: 1.4;
}

.notif-item:last-child {
  border-bottom: none;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.inline-form {
  display: inline;
}

/* ---- Buttons ---- */

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.btn-primary {
  background: var(--blue-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--blue-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg);
}

.btn-provider {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-primary);
}

.btn-provider:hover {
  background: var(--bg);
}

.btn-github {
  border-color: #24292e;
}

.btn-linkedin {
  border-color: #0a66c2;
}


/* ---- Flash ---- */

.flash {
  max-width: 1128px;
  margin: 8px auto;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
}

.flash-notice {
  background: #e6f4ea;
  color: var(--success);
}

.flash-error {
  background: #fce8e6;
  color: var(--error);
}

/* ---- Main content ---- */

.main-content {
  max-width: 1128px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* ---- Feed layout ---- */

.feed-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.sidebar-left {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 68px;
  max-height: calc(100vh - 84px);
  overflow-y: auto;
}

.feed-main {
  flex: 1;
  min-width: 0;
  max-width: 680px;
}

/* ---- Profile card ---- */

.profile-card {
  text-align: center;
  padding: 20px 16px;
}

.profile-avatar {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.profile-avatar .avatar {
  width: 64px;
  height: 64px;
}

.profile-name {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 4px;
}

.profile-role {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.cta-btn {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 12px;
}

.profile-about {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  text-align: left;
}

/* ---- Ad card ---- */

.ad-card {
  text-align: center;
  padding: 16px;
}

.ad-label {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.ad-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.ad-title-link {
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
  text-decoration: none;
}

.ad-title-link:hover {
  color: var(--blue-primary);
}

.ad-tagline {
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 10px;
}

.ad-body {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.ad-cta {
  display: block;
  width: 100%;
  text-align: center;
  margin-bottom: 8px;
}

.ad-trust {
  font-size: 10px;
  color: var(--text-secondary);
  font-style: italic;
}

/* ---- Right sidebar / Jobs ---- */

.sidebar-right {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 68px;
}

.jobs-card {
  padding: 0;
}

.jobs-title {
  font-weight: 700;
  font-size: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

a.job-listing {
  display: block;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: background 0.15s;
}

a.job-listing:last-child {
  border-bottom: none;
}

a.job-listing:hover {
  background: var(--bg);
}

.job-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--blue-primary);
}

/* ---- Role page ---- */

.role-page {
  max-width: 680px;
  margin: 0 auto;
}

.role-header-card {
  text-align: center;
}

.role-header-card h1 {
  font-size: 22px;
}

.role-count {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

.person-about {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 8px;
}

/* ---- Hashtags ---- */

.hashtag {
  color: var(--blue-primary);
  text-decoration: none;
  font-weight: 500;
}

.hashtag:hover {
  text-decoration: underline;
}

/* ---- Post role ---- */

.post-role {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---- Feed header ---- */

.feed-header {
  text-align: center;
  margin-bottom: 24px;
}

.feed-header h1 {
  font-size: 28px;
  font-weight: 700;
}

.feed-subtitle {
  color: var(--text-secondary);
  font-size: 16px;
  margin-top: 4px;
}

/* ---- Cards ---- */

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

/* ---- Compose ---- */

.compose-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.compose-prompt {
  color: var(--text-secondary);
  font-size: 14px;
}

.compose-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
}

.compose-form textarea:focus {
  outline: none;
  border-color: var(--blue-primary);
}

.compose-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.compose-hint {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---- Avatar ---- */

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue-primary);
  object-fit: cover;
  flex-shrink: 0;
}

/* ---- Posts ---- */

.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.post-meta {
  display: flex;
  flex-direction: column;
}

.post-author {
  font-weight: 600;
  font-size: 14px;
}

.post-time {
  font-size: 12px;
  color: var(--text-secondary);
}

.post-body {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 12px;
  white-space: pre-line;
}

.post-original {
  margin-bottom: 12px;
  font-size: 13px;
}

.post-original summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12px;
}

.post-original summary:hover {
  color: var(--blue-primary);
}

.post-original p {
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 4px;
  color: var(--text-secondary);
  font-style: italic;
}

.post-actions {
  display: flex;
  gap: 4px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.action-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.action-btn:hover {
  background: var(--bg);
  color: var(--text-primary);
}

.action-btn.active {
  color: var(--blue-primary);
  background: var(--blue-light);
}

/* ---- Pagination ---- */

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 16px 0;
}

/* ---- Post image ---- */


.post-image {
  margin: 12px 0;
}

.post-image img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* ---- Reactions ---- */

.post-actions {
  display: flex;
  gap: 4px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 12px;
}

.react-form {
  display: inline;
}

.action-btn {
  background: none;
  border: none;
  padding: 6px 12px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 4px;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.action-btn:hover {
  background: var(--bg);
  color: var(--text-primary);
}

.action-btn.active {
  color: var(--blue-primary);
  background: var(--blue-light);
}

.react-count {
  font-size: 12px;
  font-weight: 600;
}

.action-btn-sm {
  font-size: 12px;
  padding: 3px 8px;
}

.reply-actions {
  display: flex;
  gap: 2px;
  padding-left: 36px;
  margin-top: 4px;
}

/* ---- Replies ---- */

.replies {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 12px;
}

.reply {
  padding: 8px 0 8px 52px;
}

.reply + .reply {
  border-top: 1px solid var(--border);
}

.reply-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.reply-header .avatar {
  width: 28px;
  height: 28px;
}

.reply-body {
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-line;
  padding-left: 36px;
}

.reply-form {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 8px;
}

.reply-compose {
  display: flex;
  gap: 8px;
  align-items: center;
}

.reply-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: inherit;
  font-size: 13px;
}

.reply-input:focus {
  outline: none;
  border-color: var(--blue-primary);
}

.btn-reply {
  padding: 6px 16px;
  font-size: 13px;
}

/* ---- Empty state ---- */

.empty-state {
  text-align: center;
  padding: 48px 16px;
}

.empty-state h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
}

/* ---- Auth ---- */

.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.auth-card {
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.auth-card h1 {
  font-size: 24px;
  margin-bottom: 4px;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

.auth-providers {
  margin-bottom: 16px;
}

.auth-notice {
  font-size: 12px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* ---- Footer ---- */

.footer {
  max-width: 1128px;
  margin: 48px auto 0;
  padding: 24px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}

.footer a {
  color: var(--blue-primary);
  text-decoration: none;
}

.footer-disclaimer {
  margin-top: 4px;
  font-style: italic;
}

/* ---- Dev login ---- */

.dev-user-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dev-name-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
  .main-content {
    padding: 16px 12px;
  }


  .feed-layout {
    flex-direction: column;
  }

  .sidebar-left {
    width: 100%;
    position: static;
  }

  .sidebar-right {
    display: none;
  }

  .feed-main {
    max-width: 100%;
  }

  .compose-footer {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }

  .compose-hint {
    text-align: center;
  }

  .profile-card {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    padding: 12px 16px;
  }

  .profile-avatar {
    margin-bottom: 0;
  }

  .profile-avatar .avatar {
    width: 48px;
    height: 48px;
  }

  .profile-about {
    display: none;
  }

  .profile-role {
    margin-bottom: 0;
  }
}
