.people-grid, .profile-grid, .inbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.people-card { min-width: 0; padding: 1.15rem; }
.people-card-header, .people-tree-row, .people-actions, .profile-identity, .people-meta, .people-reactions, .inbox-item-head {
  display: flex;
  gap: .55rem;
  align-items: center;
}
.people-actions, .people-meta, .people-reactions, .inbox-item-head { flex-wrap: wrap; }
.people-card-header, .people-tree-row { justify-content: space-between; }
.people-card-header { margin-bottom: .95rem; }
.people-card h2, .profile-hero h2, .inbox-item h3, .people-shop h3 { margin: 0; }
.people-card h2 { font-size: 1.15rem; }
.people-card-header p, .people-manager p, .inbox-item p, .people-shop p { color: var(--muted); margin: .25rem 0 0; }
.people-card-header p, .people-manager p, .inbox-item p, .inbox-item time, .people-shop p { font-size: .875rem; }

.people-tree, .people-awards { list-style: none; margin: 0; padding: 0; }
.people-tree ul { margin-inline-start: .65rem; padding-inline-start: .7rem; border-inline-start: 1px solid var(--line); }
.people-tree li { margin: 0 0 .4rem; }
.people-tree-root { margin-bottom: 1rem; }
.people-row-actions { justify-content: flex-end; flex: 0 1 auto; }
.people-row-actions .button { font-size: .875rem; min-height: 34px; padding: 5px 9px; }
.people-tree-row { flex-wrap: wrap; }
.people-external-manager { color: var(--muted); font-size: .8rem; margin: .1rem .4rem .4rem; }
.person-row {
  display: inline-flex;
  align-items: center;
  text-align: start;
  gap: .65rem;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: .65rem;
  min-width: 0;
  padding: .3rem .4rem;
  cursor: pointer;
}
.person-row:hover, .person-row:focus-visible { background: var(--soft); }
.person-row > :first-child { flex-shrink: 0; }
.person-row strong, .person-row small, .people-awards small { display: block; overflow-wrap: anywhere; }
.person-row strong { font-size: .95rem; }
.person-row small, .people-awards small { font-size: .8rem; color: var(--muted); margin-top: .13rem; }

.people-form > .people-actions { justify-content: flex-end; margin-top: 1rem; }
.people-form .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.people-form .form-grid > :only-child { grid-column: 1 / -1; }
.people-field-wide { grid-column: 1 / -1; }
.people-checkbox { display: flex; gap: .4rem; align-items: center; }
.people-checkbox input { width: auto; }
.people-form textarea, .people-comment-form textarea { resize: vertical; }
.profile-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding: 1.45rem;
  margin-bottom: 1rem;
  background: linear-gradient(110deg, color-mix(in srgb, var(--accent) 15%, var(--surface)), var(--surface) 72%);
}
.profile-identity { gap: 1rem; min-width: 0; }
.profile-identity > :first-child { flex-shrink: 0; }
.profile-identity h2 { font-size: clamp(1.35rem, 3vw, 2rem); overflow-wrap: anywhere; }
.profile-identity p { margin: .2rem 0 .45rem; color: var(--muted); overflow-wrap: anywhere; }
.people-meta { margin-top: .5rem; }
.people-meta .badge, .inbox-item .badge, .people-card-header .badge { display: inline-flex; padding: .26rem .55rem; background: var(--soft); border-radius: 999px; font-size: .8rem; font-weight: 650; color: var(--text); }
.people-reaction { min-width: 2.45rem; min-height: 2.45rem; padding: .2rem .42rem; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: .65rem; cursor: pointer; }
.people-reaction[aria-pressed='true'] { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.people-reaction:disabled { cursor: default; }
.profile-bio, .people-comment p { white-space: pre-wrap; overflow-wrap: anywhere; }
.people-contacts, .people-metrics { margin: 0; }
.people-contacts > div { display: grid; grid-template-columns: minmax(5rem, .45fr) 1fr; gap: .5rem; padding-block: .6rem; border-bottom: 1px solid var(--line); }
.people-contacts dt, .people-metrics dt { color: var(--muted); font-size: .85rem; }
.people-contacts dd, .people-metrics dd { margin: 0; overflow-wrap: anywhere; }
.people-manager { margin-top: .75rem; }
.people-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; margin-bottom: .9rem; }
.people-metrics > div { padding: .6rem; border-radius: .65rem; background: var(--soft); }
.people-metrics dd { margin-top: .12rem; font-size: 1.35rem; font-weight: 750; }
.people-awards li, .people-shop-item { display: flex; gap: .7rem; align-items: center; padding: .5rem 0; }
.people-reward-icon { display: grid; place-items: center; flex-shrink: 0; width: 2.5rem; height: 2.5rem; border-radius: .65rem; background: var(--soft); }
.people-shop-item { border-block-start: 1px solid var(--line); }
.people-shop-item h3 { font-size: 1rem; }
.people-shop-item > .button { margin-inline-start: auto; flex-shrink: 0; }
.people-comment-form { display: flex; align-items: flex-end; gap: .7rem; }
.people-comment-form > label { flex: 1; }
.people-comment-form > button { flex-shrink: 0; }
.people-comment-list { margin-top: 1rem; }
.people-comment { padding: .6rem 0; border-top: 1px solid var(--line); }
.people-comment time { font-size: .8rem; color: var(--muted); margin-inline-start: .4rem; }
.people-comment p { margin: .45rem .4rem; }

.inbox-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.inbox-list { display: grid; gap: .6rem; }
.inbox-item { display: flex; align-items: flex-start; gap: .65rem; padding: .75rem; border: 1px solid var(--line); border-radius: .75rem; }
.inbox-item h3 { font-size: .95rem; overflow-wrap: anywhere; }
.inbox-item time { display: block; color: var(--muted); margin-top: .25rem; }
.inbox-item .button { font-size: .875rem; }
.inbox-unread { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.inbox-item .people-swap-approved { background: color-mix(in srgb, #54bc6c 24%, var(--surface)); }
.inbox-item .people-swap-rejected { background: color-mix(in srgb, #ed6e7d 24%, var(--surface)); }
.inbox-item .people-swap-pending_manager, .inbox-item .people-swap-pending_peer { background: color-mix(in srgb, #e1ad34 24%, var(--surface)); }
.inbox-symbol { display: grid; place-items: center; flex-shrink: 0; border-radius: .55rem; width: 2rem; height: 2rem; background: var(--soft); }
.inbox-body { flex: 1; min-width: 0; }
.inbox-actions { margin-top: .7rem; }

@media (max-width: 1050px) {
  .people-grid, .inbox-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .profile-grid { grid-template-columns: minmax(0, 1fr); }
  .profile-hero { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 450px) {
  .people-card, .profile-hero { padding: .8rem; }
  .people-tree ul { margin-inline-start: .25rem; padding-inline-start: .35rem; }
  .person-row { gap: .4rem; }
  .inbox-item { flex-wrap: wrap; }
  .people-comment-form { flex-direction: column; align-items: stretch; }
  .people-form .form-grid { grid-template-columns: minmax(0, 1fr); }
}

.profile-hero { position: relative; isolation: isolate; overflow: hidden; flex-wrap: wrap; gap: 12px; }
.profile-bg-default { background: radial-gradient(ellipse at 86% 0%, #b4e45666, transparent 62%), var(--surface); }
.profile-bg-ocean { background: radial-gradient(ellipse at 90% 15%, #49dce09c, transparent 55%), linear-gradient(120deg, var(--surface), #398ce273); }
.profile-bg-lavender { background: radial-gradient(ellipse at 90% 10%, #bb92ff99, transparent 55%), linear-gradient(120deg, var(--surface), #746dfa66); }
.profile-bg-sunset { background: radial-gradient(ellipse at 84% 8%, #ffb057bf, transparent 58%), linear-gradient(120deg, var(--surface), #f55c806b); }
.profile-bg-arcade { background: repeating-linear-gradient(130deg, #8266ff36 0 2px, transparent 2px 16px), linear-gradient(120deg, var(--surface), #e947bd65); }
.profile-bg-mint { background: radial-gradient(ellipse at 85% 20%, #5af5a7a5, transparent 60%), linear-gradient(120deg, var(--surface), #40b0a15e); }
.profile-cover-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.profile-hero:has(.profile-cover-image)::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, var(--surface), color-mix(in srgb, var(--surface) 72%, transparent) 57%, transparent);
}
.profile-flair { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
.profile-points, .profile-mood {
  display: inline-flex; align-items: center; padding: 6px 11px; border-radius: 100px;
  background: var(--surface); color: var(--text); font-size: .83rem; font-weight: 700;
}
.profile-points { background: var(--accent); color: #202b14; }
.cover-choices {
  min-width: 0; margin: 0; padding: 0; border: 0; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px;
}
.cover-choices legend { margin-bottom: 8px; font-weight: 700; }
.cover-choice {
  display: flex; align-items: end; gap: 6px; min-height: 64px; padding: 8px; border-radius: 10px;
  border: 1px solid var(--line); cursor: pointer; font-size: .83rem;
}
.cover-choice input { accent-color: #578b30; }
.cover-choice:has(input:checked) { outline: 2px solid #6c9e36; outline-offset: -2px; }
.exchange-card .inbox-body { flex: 1; min-width: 0; }
.swap-flow { display: grid; gap: 5px; background: var(--surface); border-radius: 10px; padding: 8px; }
.swap-flow-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) auto minmax(0, .8fr); gap: 5px; align-items: center; font-size: .79rem; }
.swap-flow-row strong { overflow-wrap: anywhere; }
.swap-flow-head, .swap-deadline { color: var(--muted); font-size: .8rem; }
.swap-type { display: inline-grid; place-items: center; padding: 4px; background: var(--soft); border-radius: 7px; overflow-wrap: anywhere; }
.swap-type[data-type="office"] { background: color-mix(in srgb, #b2df57 37%, var(--surface)); }
.swap-type[data-type="remote"] { background: color-mix(in srgb, #ab83fd 29%, var(--surface)); }
.people-swap-expired { color: var(--danger); }
.people-reward-icon[data-tier="bronze"] { background: #d58e5966; }
.people-reward-icon[data-tier="silver"] { background: #97acc57d; }
.people-reward-icon[data-tier="gold"] { background: #eab74488; }
