:root {
  --crimson: #9f1230;
  --crimson-dark: #7f0f28;
  --ink: #121417;
  --muted: #66707d;
  --line: #e3e6ea;
  --surface: #ffffff;
  --soft: #f6f5f2;
  --soft-red: #fff7f8;
  --teal: #176b73;
  --gold: #c48a1b;
  --green: #3f7b64;
  --shadow: 0 18px 48px rgba(18, 20, 23, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #f7f6f2;
  font-family:
    "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 18px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.brand,
.profile-chip,
.primary-nav a {
  text-decoration: none;
  color: inherit;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 34px;
}

.brand-mark {
  display: grid;
  width: 58px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.sidebar-group h2 {
  color: var(--muted);
  font-size: 12px;
}

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  letter-spacing: 0;
}

.primary-nav {
  display: grid;
  gap: 3px;
}

.primary-nav a,
.mobile-nav button {
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
}

.primary-nav a.active,
.primary-nav a:hover,
.mobile-nav button.active {
  color: var(--crimson);
  border-left-color: var(--crimson);
  background: transparent;
}

.sidebar-group {
  margin-top: 28px;
}

.sidebar-group h2 {
  margin: 0 0 10px;
  text-transform: none;
}

.pill-stack,
.chip-row,
.action-row,
.avatar-row,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(820px, 100%);
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  padding: 9px 12px;
}

.search-box span {
  color: var(--crimson);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.close-button {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.bell {
  width: 14px;
  height: 18px;
  border: 2px solid var(--ink);
  border-radius: 9px 9px 5px 5px;
}

.dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 9px;
  height: 9px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--crimson);
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 6px 9px;
  font-weight: 800;
}

.profile-menu {
  position: relative;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 15;
  display: grid;
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 6px;
}

.profile-dropdown.hidden {
  display: none;
}

.profile-dropdown button {
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.profile-dropdown button:hover {
  background: var(--soft);
}

#screen {
  max-width: 1440px;
  margin: 0 auto;
  padding: 34px;
}

.screen-grid {
  display: grid;
  gap: 18px;
}

.three-col {
  grid-template-columns: minmax(190px, 0.65fr) minmax(340px, 1.55fr) minmax(260px, 0.8fr);
}

.two-col {
  grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.5fr);
}

.directory-grid {
  grid-template-columns: 280px minmax(0, 1fr);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.section-head h1,
.section-head h2,
.panel h2,
.panel h3,
.profile-title h1 {
  margin: 0;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2,
h3 {
  letter-spacing: 0;
}

.section-head p,
.muted,
.meta,
.card p,
.panel p {
  color: var(--muted);
}

.section-head p {
  margin: 4px 0 0;
}

.panel,
.card,
.composer,
.result-card,
.job-card,
.event-row,
.thread-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel {
  padding: 18px;
}

.panel,
.card,
.composer,
.result-card,
.job-card,
.event-row {
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.result-card:hover,
.card:hover,
.job-card:hover,
.event-row:hover {
  border-color: #cfd5dc;
  box-shadow: 0 12px 30px rgba(18, 20, 23, 0.06);
  transform: translateY(-1px);
}

.card,
.result-card,
.job-card,
.event-row,
.thread-row {
  padding: 16px;
}

.composer {
  padding: 14px;
}

.composer textarea,
.message-input textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  outline: 0;
}

.primary,
.secondary,
.tertiary,
.pill,
.tag {
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 9px 12px;
  font-weight: 800;
}

.primary {
  color: #fff;
  background: var(--crimson);
}

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

.primary:disabled,
.secondary:disabled,
.tertiary:disabled {
  cursor: default;
  opacity: 0.62;
}

.secondary {
  color: var(--crimson);
  border-color: #d6a6af;
  background: #fff;
}

.secondary.active {
  color: #fff;
  border-color: var(--crimson);
  background: var(--crimson);
}

.tertiary,
.pill.ghost {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface);
}

.pill,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  background: var(--soft);
  font-size: 12px;
}

.tag.verified,
.tag.open {
  color: #2f6752;
  background: #edf4f0;
}

.tag.crimson {
  color: var(--crimson);
  background: var(--soft-red);
}

.tag.gold {
  color: #805800;
  background: #fff5dc;
}

.feed {
  display: grid;
  gap: 14px;
}

.post-head,
.person-line,
.result-head,
.message-head,
.job-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.post-head,
.result-head,
.job-head {
  justify-content: space-between;
}

.person-line {
  justify-content: flex-start;
}

.avatar {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(166, 15, 45, 0.88), rgba(0, 127, 132, 0.82)),
    var(--crimson);
  font-size: 14px;
  font-weight: 900;
}

.avatar-sm {
  width: 30px;
  height: 30px;
  font-size: 11px;
}

.avatar-lg {
  width: 86px;
  height: 86px;
  font-size: 24px;
}

.avatar.gold {
  background: linear-gradient(135deg, #c48a1b, #693e76);
}

.avatar.teal {
  background: linear-gradient(135deg, #007f84, #243b6b);
}

.avatar.green {
  background: linear-gradient(135deg, #27825a, #243b6b);
}

.avatar-row .avatar {
  margin-right: -14px;
  border: 2px solid #fff;
}

.avatar-row .avatar:last-child {
  margin-right: 0;
}

.post-body {
  margin: 12px 0;
  font-size: 16px;
  line-height: 1.5;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.inline-actions button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.inline-actions button:last-child {
  color: var(--crimson);
}

.rail-list {
  display: grid;
  gap: 12px;
}

.mini-person {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}

.mini-person strong,
.thread-row strong,
.result-card strong,
.job-card strong {
  display: block;
}

.filter-panel {
  align-self: start;
  position: sticky;
  top: 88px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field label,
.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: none;
}

.field input,
.field select,
.compact-actions select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  padding: 10px;
  outline: 0;
}

.directory-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--crimson);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 760px;
  margin: 12px 0 20px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.45;
}

.directory-search {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 820px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: #fff;
  padding: 13px 15px;
}

.directory-search span {
  color: var(--crimson);
  font-size: 12px;
  font-weight: 900;
}

.directory-search input {
  width: 100%;
  border: 0;
  outline: 0;
}

.quick-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.trust-line {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.stats-grid {
  display: grid;
  gap: 10px;
}

.stats-grid div {
  border-top: 1px solid var(--line);
  padding: 14px 0 4px;
}

.stats-grid strong,
.stats-grid span {
  display: block;
}

.stats-grid strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  line-height: 1;
}

.stats-grid span {
  color: var(--muted);
  margin-top: 4px;
}

.filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.filter-head h2 {
  margin: 0;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--crimson);
  font-weight: 800;
  padding: 0;
}

.range-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.results-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.results-toolbar strong {
  display: block;
  font-size: 20px;
}

.results-toolbar p {
  margin: 4px 0 0;
}

.compact-actions {
  align-items: center;
}

.compact-actions select {
  width: auto;
  min-width: 190px;
}

.results-list {
  display: grid;
  gap: 12px;
}

.results-list.grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.result-card {
  display: grid;
  gap: 12px;
}

.warmth-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d6a6af;
  border-radius: 999px;
  color: var(--crimson);
  background: #fff;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
}

.warm-path {
  display: grid;
  gap: 4px;
  border-left: 3px solid var(--crimson);
  background: #fbfaf7;
  padding: 10px 12px;
}

.warm-path span,
.help-line {
  color: var(--muted);
}

.card-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.card-facts div {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px;
}

.card-facts strong,
.card-facts span {
  display: block;
}

.card-facts span {
  color: var(--muted);
  font-size: 12px;
}

.help-line {
  margin: 0;
}

.mutual-card,
.referrer-card,
.intro-card {
  border: 1px solid #efc4ce;
  border-left: 5px solid var(--crimson);
  border-radius: var(--radius);
  background: var(--soft-red);
  padding: 16px;
}

.profile-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(166, 15, 45, 0.08), rgba(0, 127, 132, 0.08)),
    #fff;
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.connections-layout,
.messages-layout,
.jobs-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
}

.connection-filters {
  display: grid;
  gap: 10px;
}

.message-list,
.job-list {
  display: grid;
  gap: 10px;
}

.thread-row,
.job-card {
  text-align: left;
}

.thread-row.active,
.job-card.active {
  border-color: var(--crimson);
  box-shadow: inset 4px 0 0 var(--crimson);
}

.unread {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--crimson);
}

.message-window {
  display: grid;
  min-height: 630px;
  grid-template-rows: auto 1fr auto;
}

.message-log {
  display: grid;
  align-content: end;
  gap: 12px;
  padding: 18px 0;
}

.bubble {
  max-width: 76%;
  border-radius: var(--radius);
  background: var(--soft);
  padding: 12px;
}

.bubble.me {
  justify-self: end;
  color: #fff;
  background: var(--crimson);
}

.smart-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.split-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 18px;
}

.edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.editable {
  min-height: 42px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 10px;
}

.privacy-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: 18px;
}

.privacy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.privacy-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  padding: 10px;
  font-weight: 700;
}

.notification-popover {
  position: fixed;
  right: 24px;
  top: 72px;
  z-index: 10;
  width: min(370px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 14px;
}

.notification-popover.hidden {
  display: none;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.empty-state {
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--soft);
  padding: 14px;
}

dialog {
  width: min(720px, calc(100vw - 28px));
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

dialog::backdrop {
  background: rgba(23, 25, 31, 0.38);
}

.close-button {
  margin-left: auto;
}

.mobile-nav {
  display: none;
}

@media (max-width: 1120px) {
  .three-col,
  .directory-grid,
  .directory-hero,
  .connections-layout,
  .messages-layout,
  .jobs-layout,
  .split-detail,
  .privacy-panel {
    grid-template-columns: 1fr;
  }

  .filter-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
    padding-bottom: 68px;
  }

  .sidebar {
    display: none;
  }

  .topbar {
    padding: 12px;
    align-items: stretch;
    flex-direction: column;
  }

  #screen {
    padding: 16px;
  }

  .section-head,
  .post-head,
  .result-head,
  .job-head,
  .profile-hero {
    display: grid;
    grid-template-columns: 1fr;
  }

  .results-list.grid,
  .edit-grid,
  .privacy-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 42px;
  }

  .hero-copy {
    font-size: 17px;
  }

  .directory-search {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-actions select {
    width: 100%;
  }

  .profile-chip span:last-child {
    display: none;
  }

  .mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line);
    background: #fff;
    padding: 6px;
  }

  .mobile-nav button {
    text-align: center;
    padding: 10px 4px;
    font-size: 12px;
  }
}
