/* Public account profiles and the matching account image controls.
   The page reads as an index: identity, Reputation, then dated work. */

.profile-v2-page {
  --profile-ink: var(--tdb-ink, #151719);
  --profile-body: var(--tdb-body, #3d4b57);
  --profile-muted: var(--tdb-muted, #68727d);
  --profile-rule: var(--tdb-rule, #deded7);
  --profile-rule-strong: var(--tdb-rule-strong, #c9c7bd);
  --profile-accent: var(--tdb-accent, #24406e);
  --profile-accent-soft: var(--tdb-accent-soft, #eef1fe);
  font-family: var(--tdb-font-interface, Inter, system-ui, sans-serif);
}

/* The identity lives in the profile rail; the record header that remains is
   an empty shell and collapses. */
.profile-v2-page .record-v3-header {
  padding-bottom: 0;
  border-bottom: 0;
}

.profile-v2-identity-block {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 1.35rem;
  align-items: center;
}

.profile-v2-avatar-frame {
  width: 6.5rem;
  aspect-ratio: 1;
  border: 1px solid var(--profile-rule-strong);
  border-radius: 3px;
  background: #fff;
  overflow: hidden;
}

.profile-v2-avatar,
.profile-v2-monogram {
  display: block;
  width: 100%;
  height: 100%;
}

.profile-v2-avatar {
  object-fit: cover;
}

.profile-v2-monogram {
  display: grid;
  place-items: center;
  background: var(--profile-accent-soft);
  color: var(--profile-accent);
  font-size: 2rem;
  font-weight: 650;
  line-height: 1;
}

.profile-v2-identity-copy {
  min-width: 0;
}

.profile-v2-nav {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
}

.profile-v2-nav a {
  color: var(--profile-accent);
  text-decoration: none;
}

.profile-v2-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.profile-v2-identity-copy .record-v3-badges {
  margin-bottom: 0.55rem;
}

.profile-v2-identity-copy .record-v3-summary {
  margin-top: 0.4rem;
  color: var(--profile-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.profile-v2-report {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  margin-top: 0.55rem;
  padding: 0.25rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--profile-muted);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.profile-v2-report:hover {
  color: var(--profile-accent);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.profile-v2-page .record-v3-metrics {
  gap: 1.1rem 2.4rem;
  margin-top: 1.2rem;
}

.profile-v2-page .record-v3-metric strong {
  font-size: 1.25rem;
}

.profile-v2 {
  display: block;
  margin-top: 1.65rem;
}

/* Two-column profile at the search page's width: a compact identity box on
   the left, the work column taking everything else. */
.record-v3.record-v3--wide {
  width: min(calc(100vw - 2.5rem), 80rem);
}

.profile-v2-grid {
  display: grid;
  grid-template-columns: minmax(12rem, 14rem) minmax(0, 1fr);
  gap: 1.6rem 2.25rem;
  align-items: start;
}

.profile-v2-rail,
.profile-v2-main {
  min-width: 0;
}

.profile-v2-rail {
  padding: 1rem;
  border: 1px solid var(--profile-rule);
  background: color-mix(in srgb, var(--profile-rule) 22%, #fff);
}

.profile-v2-rail .profile-v2-identity-block {
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}

.profile-v2-rail .profile-v2-avatar-frame {
  width: 100%;
  max-width: 8.5rem;
}

.profile-v2-rail .profile-v2-monogram {
  font-size: 2.4rem;
}

.profile-v2-rail #record-title {
  margin: 0 0 0.2rem;
  font-size: 1.2rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

/* Metrics stack as labeled rows in the rail. */
.profile-v2-rail .record-v3-metrics {
  display: block;
  margin-top: 1.15rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--profile-rule);
}

.profile-v2-rail .record-v3-metric {
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  min-height: 1.9rem;
  border-bottom: 1px solid color-mix(in srgb, var(--profile-rule) 70%, transparent);
}

.profile-v2-rail .record-v3-metric strong {
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.profile-v2-rail .record-v3-metric span {
  color: var(--profile-muted);
  font-size: 0.8125rem;
}

.profile-v2-rail .profile-v2-overview {
  margin-top: 1.15rem;
}

.profile-v2-overview {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem 2.5rem;
}

.profile-v2-main .profile-v2-contributions {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.profile-v2-section {
  min-width: 0;
}

.profile-v2-section > h2,
.profile-v2-section-head h2 {
  margin: 0;
  color: var(--profile-ink);
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.profile-v2-category-list,
.profile-v2-agent-list {
  margin-top: 0.55rem;
  border-top: 1px solid var(--profile-rule);
}

.profile-v2-category {
  display: grid;
  grid-template-columns: minmax(7.5rem, auto) minmax(4rem, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  min-height: 1.9rem;
  border-bottom: 1px solid color-mix(in srgb, var(--profile-rule) 70%, transparent);
  color: var(--profile-body);
  font-size: 0.8125rem;
}

.profile-v2-category-track {
  height: 2px;
  background: color-mix(in srgb, var(--profile-rule) 75%, transparent);
}

.profile-v2-category-fill {
  display: block;
  height: 100%;
  background: var(--profile-accent);
}

.profile-v2-category strong {
  color: var(--profile-ink);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.profile-v2-agent {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.42rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--profile-rule) 70%, transparent);
}

.profile-v2-agent strong,
.profile-v2-agent a {
  display: block;
  overflow: hidden;
  color: var(--profile-ink);
  font-size: 0.8125rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-v2-agent a {
  text-decoration: none;
}

.profile-v2-agent a:hover {
  color: var(--profile-accent);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.profile-v2-agent small,
.profile-v2-agent > span {
  color: var(--profile-muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.profile-v2-contributions {
  margin-top: 1.9rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--profile-rule-strong);
}

.profile-v2-section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem 1.5rem;
}

.profile-v2-total {
  color: var(--profile-muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.profile-v2-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 1rem;
  margin-top: 0.75rem;
  border-bottom: 1px solid var(--profile-rule);
}

.profile-v2-kind-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.profile-v2-filter {
  appearance: none;
  min-height: 2rem;
  margin: 0 1rem 0 0;
  padding: 0.4rem 0 0.48rem;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--profile-muted);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.profile-v2-filter[aria-pressed="true"] {
  border-bottom-color: var(--profile-accent);
  color: var(--profile-ink);
  font-weight: 650;
}

.profile-v2-filter-count {
  margin-left: 0.25rem;
  color: var(--profile-muted);
  font-variant-numeric: tabular-nums;
}

.profile-v2-agent-filter {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-bottom: 0.35rem;
  color: var(--profile-muted);
  font-size: 0.8125rem;
}

.profile-v2-agent-filter select {
  max-width: 13rem;
  min-height: 2rem;
  padding: 0.18rem 1.65rem 0.18rem 0.4rem;
  border: 1px solid var(--profile-rule-strong);
  border-radius: 2px;
  background-color: #fff;
  color: var(--profile-ink);
  font: inherit;
  font-size: 0.8125rem;
}

/* The contribution list is the problem directory's table; rows stay one
   line: the title and the action taken. The rest waits in the hover card. */
.profile-v2-contrib-wrap {
  margin-top: 0.9rem;
}

.profile-v2-contribution {
  border-bottom: 1px solid var(--profile-rule);
}

.profile-v2-contribution-title {
  color: var(--profile-ink);
  text-decoration: none;
}

.profile-v2-contribution-title:hover {
  color: var(--profile-accent);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

/* Each row carries one colored chip naming what the item is, and a quiet
   status tag beside it. Everything further waits in the hover card. */
.profile-v2-chips {
  text-align: right;
  white-space: nowrap;
}

.profile-v2-kind-chip {
  display: inline-block;
  padding: 0.14rem 0.5rem;
  border-radius: 2px;
  background: #eef1fe;
  color: #24406e;
  font-size: 0.76rem;
  font-weight: 650;
}

.profile-v2-kind-chip[data-kind="answer"] {
  background: #e6f2ea;
  color: #2f6247;
}

.profile-v2-kind-chip[data-kind="formal"] {
  background: #efe9f8;
  color: #5b3d8a;
}

.profile-v2-kind-chip[data-kind="claim"] {
  background: #e5f1f1;
  color: #1f6f6f;
}

.profile-v2-kind-chip[data-kind="artifact"] {
  background: #f7efe0;
  color: #7a5a24;
}

.profile-v2-kind-chip[data-kind="attempt"],
.profile-v2-kind-chip[data-kind="relation"],
.profile-v2-kind-chip[data-kind="other"] {
  background: #efefeb;
  color: #5d6771;
}

.profile-v2-status-tag {
  margin-left: 0.55rem;
  color: var(--profile-muted);
  font-size: 0.76rem;
}

.profile-v2-empty,
.profile-v2-feed-status {
  margin: 0;
  padding: 0.85rem 0;
  color: var(--profile-muted);
  font-size: 0.8125rem;
}

.profile-v2-more {
  display: block;
  width: fit-content;
  min-height: 2rem;
  margin: 0.85rem 0 0;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--profile-rule-strong);
  border-radius: 2px;
  background: #fff;
  color: var(--profile-accent);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.profile-v2-more:hover {
  border-color: var(--profile-accent);
}

.profile-v2-reputation-history {
  margin-top: 1.55rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--profile-rule);
}

.profile-v2-reputation-history .profile-v2-section-head h2 {
  color: var(--profile-body);
  font-size: 0.8125rem;
}

.profile-v2-reputation-list {
  margin-top: 0.35rem;
  border-top: 1px solid color-mix(in srgb, var(--profile-rule) 65%, transparent);
}

.profile-v2-reputation-row {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr) auto;
  gap: 0.3rem 0.75rem;
  align-items: baseline;
  padding: 0.43rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--profile-rule) 65%, transparent);
}

.profile-v2-reputation-amount {
  color: var(--profile-ink);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  text-align: right;
  text-decoration: none;
}

.profile-v2-reputation-row[data-state="reversed"] .profile-v2-reputation-amount {
  color: var(--profile-negative, #9a3c35);
}

.profile-v2-reputation-main {
  min-width: 0;
}

.profile-v2-reputation-title {
  display: block;
  overflow: hidden;
  color: var(--profile-body);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-v2-reputation-title:hover {
  color: var(--profile-accent);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.profile-v2-reputation-byline {
  margin-top: 0.1rem;
  color: var(--profile-muted);
  font-size: 0.8125rem;
  line-height: 1.35;
}

.profile-v2-reputation-byline strong {
  color: var(--profile-body);
  font-weight: 600;
}

.profile-v2-reputation-facts {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  color: var(--profile-muted);
  font-size: 0.8125rem;
  white-space: nowrap;
}

.profile-v2-reputation-category {
  color: var(--profile-body);
  font-weight: 600;
}

.profile-v2-reputation-state {
  padding-left: 0.5rem;
  border-left: 1px solid var(--profile-rule);
}

.profile-v2-reputation-row[data-state="final"] .profile-v2-reputation-state {
  color: var(--profile-positive, #356c4b);
}

.profile-v2-reputation-row[data-state="provisional"] .profile-v2-reputation-state,
.profile-v2-reputation-row[data-state="held"] .profile-v2-reputation-state {
  color: var(--profile-warning, #8b642d);
}

.profile-v2-reputation-row[data-state="reversed"] .profile-v2-reputation-state {
  color: var(--profile-negative, #9a3c35);
}

.profile-v2-reputation-facts time {
  font-variant-numeric: tabular-nums;
}

.profile-v2-filter:focus-visible,
.profile-v2-agent-filter select:focus-visible,
.profile-v2-more:focus-visible,
.profile-v2-reputation-amount:focus-visible,
.profile-v2-reputation-title:focus-visible,
.profile-v2-agent a:focus-visible,
.profile-v2-report:focus-visible,
.account-v2 .account-profile-image-action:focus-visible,
.account-v2 .account-profile-image-remove:focus-visible {
  outline: 2px solid var(--profile-accent, var(--tdb-accent, #24406e));
  outline-offset: 2px;
}

/* Signed-in account rail. */
.account-v2 .account-avatar-frame {
  position: relative;
  display: grid;
  place-items: center;
  padding: 1.25rem 0.65rem;
}

.account-v2 .account-avatar-image {
  display: block;
  width: 4.75rem;
  height: 4.75rem;
  border: 1px solid color-mix(in srgb, var(--tdb-accent, #24406e) 25%, transparent);
  border-radius: 3px;
  object-fit: cover;
}

.account-v2 .account-avatar {
  border-radius: 3px;
}

.account-v2 .account-avatar-image[hidden],
.account-v2 .account-avatar[hidden] {
  display: none;
}

.account-v2 .account-profile-image-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  align-items: center;
  padding: 0.55rem 0.65rem 0.65rem;
  border-top: 1px solid var(--tdb-rule, #deded7);
}

.account-v2 .account-profile-image-input {
  position: absolute;
  width: 1px;
  min-width: 1px;
  height: 1px;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  clip-path: inset(50%);
  white-space: nowrap;
}

.account-v2 .account-profile-image-action,
.account-v2 .account-profile-image-remove {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.25rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--tdb-accent, #24406e);
  font-family: var(--tdb-font-interface, Inter, system-ui, sans-serif);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}

.account-v2 .account-profile-image-remove {
  color: var(--tdb-muted, #68727d);
}

.account-v2 .account-profile-image-action:hover,
.account-v2 .account-profile-image-remove:hover {
  border-color: transparent;
  background: transparent;
  color: var(--tdb-accent, #24406e);
}

.account-v2 .account-profile-image-status {
  flex-basis: 100%;
  margin: 0;
  color: var(--tdb-muted, #68727d);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.account-v2 .account-public-profile-link {
  color: var(--tdb-accent, #24406e);
  font-size: 0.8125rem;
  text-decoration: none;
}

.account-v2 .account-public-profile-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

@media (max-width: 42rem) {
  .profile-v2-filter,
  .profile-v2-agent-filter select,
  .profile-v2-more,
  .profile-v2-report,
  .account-v2 .account-profile-image-action,
  .account-v2 .account-profile-image-remove {
    min-height: 2.75rem;
  }

  .profile-v2-agent-filter select {
    font-size: 1rem;
  }

  .profile-v2-identity-block {
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 0.9rem;
  }

  .profile-v2-avatar-frame {
    width: 4.5rem;
  }

  .profile-v2-monogram {
    font-size: 1.5rem;
  }

  .profile-v2-grid {
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }

  .profile-v2-rail .profile-v2-identity-block {
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 0.9rem;
  }

  .profile-v2-rail .profile-v2-avatar-frame {
    width: 4.5rem;
  }

  .profile-v2-rail .profile-v2-monogram {
    font-size: 1.5rem;
  }

  .profile-v2-overview {
    grid-template-columns: 1fr;
  }

  .profile-v2-controls {
    align-items: flex-start;
  }

  .profile-v2-agent-filter {
    width: 100%;
  }

  .profile-v2-agent-filter select {
    flex: 1 1 auto;
    max-width: none;
  }

  .profile-v2-contribution {
    grid-template-columns: 1fr;
  }

  .profile-v2-contribution-facts {
    justify-content: flex-start;
  }

  .profile-v2-reputation-row {
    grid-template-columns: 2.8rem minmax(0, 1fr);
  }

  .profile-v2-reputation-facts {
    grid-column: 2;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-v2-page *,
.account-v2 .account-profile-image-form * {
    scroll-behavior: auto;
  }
}
