/* Profile view, laid out like the reference design:
   - header card: short cover, large photo overlapping it by about a quarter, name block to
     its right, activity box and main button aligned just under the cover on the right;
   - body: a left column (about a third) of small titled cards, and a main card with tabs
     whose Overview stacks About me / Shared stashes / Posts, split by thin lines;
   - phones: one column, the button beside the photo, chips scrolling sideways in one row.
   Colours come from the member's theme. Loaded last so it settles older profile rules. */

html body #app #profile-view {
  --pf-surface: var(--ui-surface, var(--panel));
  --pf-line: var(--border);
  --pf-ink: var(--ui-ink, var(--text));
  --pf-muted: var(--ui-muted, var(--muted));
  --pf-accent: var(--ui-accent, var(--accent));
  --pf-soft: color-mix(in srgb, var(--pf-accent) 11%, var(--pf-surface));
  --pf-radius: 16px;
  --pf-card-radius: 12px;
  --pf-pad: 20px;
  --pf-shadow: 0 1px 2px color-mix(in srgb, var(--pf-ink) 5%, transparent), 0 8px 24px color-mix(in srgb, var(--pf-ink) 5%, transparent);
}

html body #app #profile-view .profile-column {
  display: block;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 24px 48px;
}

/* ---------- header card ---------- */

html body #app #profile-view .pf-card {
  background: var(--pf-surface);
  border: 1px solid var(--pf-line);
  border-radius: var(--pf-radius);
  box-shadow: var(--pf-shadow);
}
html body #app #profile-view .pf-head { position: relative; overflow: hidden; }

html body #app #profile-view .pf-cover {
  position: relative;
  height: 136px;
  overflow: hidden;
  border-radius: var(--pf-radius) var(--pf-radius) 0 0;
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--pf-accent) 70%, #fff) 0%, transparent 55%),
    linear-gradient(115deg, var(--pf-accent) 0%, color-mix(in srgb, var(--pf-accent) 55%, #0b1410) 60%, color-mix(in srgb, var(--pf-accent) 25%, #050a07) 100%);
}
html body #app #profile-view .pf-waves { position: absolute; inset: 0; width: 100%; height: 100%; }
html body #app #profile-view .pf-waves path { fill: none; stroke: rgba(255, 255, 255, .16); stroke-width: 1.4; }

/* Photo | name block | activity box | button, all hanging from the cover's lower edge. */
html body #app #profile-view .pf-head-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "photo id facts cta";
  align-items: start;
  column-gap: 24px;
  padding: 0 24px 24px 32px;
}

html body #app #profile-view .pf-photo { grid-area: photo; position: relative; margin-top: -48px; }
html body #app #profile-view .pf-photo .avatar.xl {
  display: grid;
  place-items: center;
  width: 176px;
  height: 176px;
  min-width: 0;
  border-radius: 50%;
  border: 5px solid var(--pf-surface);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--pf-ink) 12%, transparent);
  font-size: 3.5rem;
  object-fit: cover;
}
html body #app #profile-view .pf-cam {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 3px solid var(--pf-surface);
  border-radius: 50%;
  background: var(--pf-accent);
  color: #fff;
  cursor: pointer;
}
html body #app #profile-view .pf-cam .icon { width: 16px; height: 16px; }

html body #app #profile-view .pf-id { grid-area: id; min-width: 0; padding-top: 16px; }
html body #app #profile-view .pf-name-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
html body #app #profile-view .pf-name-row > :not(h1) { margin: 0; }
html body #app #profile-view .pf-name {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--pf-ink);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
}
html body #app #profile-view .pf-sub { margin: 4px 0 0; color: var(--pf-muted); font-size: .9375rem; line-height: 1.4; }

html body #app #profile-view .pf-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
html body #app #profile-view .pf-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 4px;
  background: var(--pf-soft);
  color: var(--pf-ink);
  font-size: .875rem;
  font-weight: 500;
}
html body #app #profile-view .pf-chip .icon { width: 16px; height: 16px; color: var(--pf-ink); }

/* Round quick-action buttons, a row under the chip. */
html body #app #profile-view .pf-rounds { display: flex; flex-wrap: nowrap; gap: 12px; margin: 18px 0 0; padding: 0; border: 0; background: none; }
html body #app #profile-view .pf-round {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--pf-line);
  border-radius: 50%;
  background: var(--pf-surface);
  color: var(--pf-ink);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--pf-ink) 8%, transparent);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
html body #app #profile-view .pf-round .icon { width: 20px; height: 20px; }
html body #app #profile-view .pf-round:hover { background: var(--pf-soft); border-color: color-mix(in srgb, var(--pf-accent) 40%, var(--pf-line)); }
html body #app #profile-view .pf-round:active { transform: scale(.94); }
html body #app #profile-view .pf-round.is-tracked { background: var(--pf-accent); border-color: var(--pf-accent); color: #fff; }

/* Activity box: label on top (coloured), value, short note; columns split by thin lines. */
html body #app #profile-view .pf-facts {
  grid-area: facts;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
  padding: 14px 4px 16px;
  border: 1.5px solid var(--pf-line);
  border-radius: 12px;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--pf-ink) 5%, transparent);
}
html body #app #profile-view .pf-fact { display: grid; align-content: start; gap: 2px; min-width: 0; padding: 0 16px; }
html body #app #profile-view .pf-fact + .pf-fact { border-left: 1.5px solid var(--pf-line); }
html body #app #profile-view .pf-fact-label { font-size: .9375rem; font-weight: 700; }
html body #app #profile-view .pf-fact strong { color: var(--pf-ink); font-size: 1.125rem; font-weight: 700; line-height: 1.3; }
html body #app #profile-view .pf-fact-sub { color: var(--pf-muted); font-size: .75rem; line-height: 1.35; white-space: nowrap; }
html body #app #profile-view .pf-fact.tone-coral .pf-fact-label { color: var(--coral, #e06c6c); }
html body #app #profile-view .pf-fact.tone-teal .pf-fact-label { color: var(--pf-accent); }
html body #app #profile-view .pf-fact.tone-gold .pf-fact-label { color: var(--gold-text, var(--gold)); }

/* Main button, top right, level with the activity box. */
html body #app #profile-view .pf-cta { grid-area: cta; display: block; margin: 12px 0 0; padding: 0; border: 0; background: none; }
html body #app #profile-view .pf-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-height: 42px;
  padding: 0 22px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-text, #fff);
  font-size: .9375rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 28%, transparent);
  cursor: pointer;
}
html body #app #profile-view .pf-cta-btn .icon { width: 18px; height: 18px; }
html body #app #profile-view .pf-cta-btn:hover { filter: brightness(1.05); }

/* ---------- body: left cards and the main card ---------- */

html body #app #profile-view .pf-layout {
  display: grid;
  grid-template-columns: minmax(280px, 32%) minmax(0, 1fr);
  align-items: start;
  gap: 20px;
  margin-top: 24px;
}

html body #app #profile-view .pf-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
html body #app #profile-view .pf-side > :empty { display: none; }

/* Each left card: a small bold title with a line under it, then its content. */
html body #app #profile-view .pf-side > div > section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0 16px 16px;
  background: var(--pf-surface);
  border: 1px solid var(--pf-line);
  border-radius: var(--pf-card-radius);
  box-shadow: var(--pf-shadow);
}
html body #app #profile-view .pf-side > div > section > :not(:is(.lj-title, .pf-h)) { margin-top: 0; margin-bottom: 0; }
html body #app #profile-view .pf-side > div > section > :first-child:not(:is(.lj-title, .pf-h)) { margin-top: 16px; }
html body #app #profile-view .pf-side :is(.lj-title, .pf-h) {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 -16px 2px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--pf-line);
  color: var(--pf-ink);
  font-size: .9375rem;
  font-weight: 650;
  line-height: 1.3;
}
html body #app #profile-view .pf-side .lj-title .icon { width: 18px; height: 18px; color: var(--pf-accent); }

/* Outlined tags, like the design's skill and proficiency chips. */
html body #app #profile-view :is(.pf-side .skill-chip, .pf-side .badge-chip, .pf-side .m-badge) {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  margin: 0;
  padding: 4px 9px;
  border: 1px solid color-mix(in srgb, var(--pf-accent) 45%, var(--pf-line));
  border-radius: 3px;
  background: color-mix(in srgb, var(--pf-accent) 6%, var(--pf-surface));
  color: var(--pf-ink);
  font-size: .8125rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
}
html body #app #profile-view :is(.pf-side .skill-chip, .pf-side .m-badge) .icon { width: 13px; height: 13px; }
html body #app #profile-view .pf-side .skill-chip.match { border-color: var(--pf-accent); background: var(--pf-soft); }
html body #app #profile-view .pf-side :is(.skill-chips, .badges, .m-badges) { display: flex; flex-wrap: wrap; gap: 8px; }
html body #app #profile-view .pf-side .skills-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
html body #app #profile-view .pf-side .m-profile-head { gap: 12px; }

html body #app #profile-view .pf-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  border: 1px solid color-mix(in srgb, var(--pf-accent) 45%, var(--pf-line));
  border-radius: 6px;
  background: var(--pf-soft);
  color: var(--pf-ink);
  font-weight: 600;
  cursor: pointer;
}
html body #app #profile-view .pf-outline .icon { width: 17px; height: 17px; }

/* Main card: tabs on top (left-aligned, underline on the selected one), then sections. */
html body #app #profile-view .pf-main {
  min-width: 0;
  overflow: hidden;
  background: var(--pf-surface);
  border: 1px solid var(--pf-line);
  border-radius: var(--pf-card-radius);
  box-shadow: var(--pf-shadow);
}
html body #app #profile-view #profile-tabs.pf-tabs {
  display: flex;
  gap: 28px;
  min-height: 0;
  width: 100%;
  margin: 0;
  padding: 0 var(--pf-pad);
  border-bottom: 1px solid var(--pf-line);
}
html body #app #profile-view .pf-tabs button {
  position: relative;
  flex: none;
  min-height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--pf-ink);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
}
html body #app #profile-view .pf-tabs button[aria-selected="true"] { color: var(--pf-accent); }
html body #app #profile-view .pf-tabs button[aria-selected="true"]::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--pf-accent);
}

html body #app #profile-view .pf-panel { margin: 0; padding: 0 var(--pf-pad); width: auto; }
html body #app #profile-view #profile-about-panel:not([hidden]), html body #app #profile-view #profile-thanks-panel:not([hidden]) { display: block; padding-top: 0; }
html body #app #profile-view #profile-posts-panel { margin-inline: 0; width: auto; }
/* Sections stacked like About Me / Experience / Portfolio, with a thin line between. */
html body #app #profile-view .pf-panel .pf-section { padding: 18px 0 20px; }
html body #app #profile-view .pf-panel .pf-section:empty { display: none; }
html body #app #profile-view .pf-panel .pf-section + .pf-section { border-top: 1px solid var(--pf-line); }
html body #app #profile-view .pf-panel .access-card { margin: 18px 0 0; }
html body #app #profile-view .pf-h { margin: 0 0 12px; color: var(--pf-ink); font-size: .9375rem; font-weight: 650; }
html body #app #profile-view .pf-about { margin: 0; padding: 0; border: 0; }
html body #app #profile-view .pf-bio { margin: 0 0 8px; color: var(--pf-ink); font-size: .9375rem; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
html body #app #profile-view .profile-stashes h2 { margin: 0 0 12px; font-size: .9375rem; font-weight: 650; }

/* Posts: the "Portfolio" grid. */
html body #app #profile-view #profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  width: 100%;
  overflow: visible;
  border-radius: 0;
}
html body #app #profile-view #profile-grid .thumb { aspect-ratio: 1; overflow: hidden; border-radius: 8px; border: 1px solid var(--pf-line); }
html body #app #profile-view #profile-more { margin-top: 16px; }

/* Thank-yous: two per row, logo-style avatar beside the text, like "Experience". */
html body #app #profile-view .pf-thanks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; margin: 0; padding: 0; list-style: none; }
html body #app #profile-view .pf-thank { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; }
html body #app #profile-view .pf-thank > div { display: grid; gap: 2px; min-width: 0; }
html body #app #profile-view .pf-thank strong { color: var(--pf-ink); font-size: .875rem; }
html body #app #profile-view .pf-thank-from .user-link { padding: 0; font-size: .8125rem; font-weight: 600; }
html body #app #profile-view .pf-thank-date { color: var(--pf-muted); font-size: .75rem; }
html body #app #profile-view .pf-thank p { margin: 4px 0 0; color: var(--pf-ink); font-size: .8125rem; line-height: 1.5; overflow-wrap: anywhere; }
html body #app #profile-view .pf-thank-btn { width: auto; margin-top: 18px; padding: 0 16px; }

/* ---------- smaller laptops and tablets ---------- */

@media (max-width: 1180px) {
  html body #app #profile-view .pf-head-body {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "photo id cta" "photo facts facts";
  }
  html body #app #profile-view .pf-facts { justify-self: start; margin-top: 16px; }
}

@media (max-width: 900px) {
  html body #app #profile-view .pf-layout { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- phones: the mobile design ---------- */

@media (max-width: 720px) {
  html body #app #profile-view { --pf-pad: 16px; }
  html body #app #profile-view .profile-column { padding: 12px 12px 28px; }
  html body #app #profile-view .pf-cover { height: 116px; }
  html body #app #profile-view .pf-head-body {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "photo cta" "id id" "facts facts";
    column-gap: 12px;
    padding: 0 16px 18px;
  }
  html body #app #profile-view .pf-photo { margin-top: -50px; }
  html body #app #profile-view .pf-photo .avatar.xl { width: 100px; height: 100px; border-width: 4px; font-size: 2.25rem; }
  html body #app #profile-view .pf-cam { right: 0; bottom: 0; width: 32px; height: 32px; }
  html body #app #profile-view .pf-cta { justify-self: end; margin-top: 14px; }
  html body #app #profile-view .pf-id { padding-top: 10px; }
  html body #app #profile-view .pf-name { font-size: 1.375rem; }
  html body #app #profile-view .pf-rounds { gap: 12px; margin-top: 16px; }
  html body #app #profile-view .pf-facts { justify-self: stretch; margin-top: 16px; }
  html body #app #profile-view .pf-fact { min-width: 0; padding: 0 12px; }
  html body #app #profile-view .pf-fact-sub { white-space: normal; }
  html body #app #profile-view .pf-layout { gap: 12px; margin-top: 12px; }
  html body #app #profile-view .pf-side { gap: 12px; }
  /* Chips run in one row and scroll sideways, as in the mobile design. */
  html body #app #profile-view .pf-side :is(.skill-chips, .badges, .m-badges) {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: -16px;
    padding: 0 16px 2px;
    scrollbar-width: none;
  }
  html body #app #profile-view .pf-side :is(.skill-chips, .badges, .m-badges)::-webkit-scrollbar { display: none; }
  html body #app #profile-view #profile-grid { gap: 8px; }
  html body #app #profile-view .pf-thanks { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 380px) {
  html body #app #profile-view .pf-fact { padding: 0 8px; }
  html body #app #profile-view .pf-fact-sub { display: none; }
}

/* Quick actions carry a visible word: icon + label pills instead of bare circles. */
html body #app #profile-view .pf-rounds { flex-wrap: wrap; gap: 8px; }
html body #app #profile-view .pf-round.has-label { display: inline-flex; align-items: center; gap: 6px; width: auto; height: 40px; min-height: 40px; padding: 0 14px; border-radius: 999px; box-shadow: none; font-size: .8125rem; font-weight: 500; }
html body #app #profile-view .pf-round.has-label .icon { width: 18px; height: 18px; }
html body #app #profile-view .pf-round-label { white-space: nowrap; }
