.profile-page { max-width:68rem; padding-block:var(--page-inset) var(--page-end); font-size:14px; }
.profile-page h1 { margin-block:0 .4em; font-size:clamp(28px,3vw,36px); font-weight:650; letter-spacing:-.04em; line-height:1.15; }
.profile-page h2 { font-size:20px; font-weight:600; letter-spacing:-.025em; margin:0 0 16px; }
.profile-page > section { max-width:38rem; padding-block:1.6rem; border-bottom:1px solid var(--line,#aab1b8); }
.profile-page > section:first-of-type { margin-top:.75rem; }
.profile-page p { line-height:1.5; }
.profile-page button,.profile-page .profile-file { width:fit-content; padding:.55em .9em; min-height:36px; font:inherit; color:inherit; border:1px solid var(--line,#aab1b8); border-radius:8px; background:transparent; cursor:pointer; }
.profile-page button:hover,.profile-page .profile-file:hover { background:color-mix(in srgb,currentColor 6%,transparent); }
.profile-page button:disabled { opacity:.5; cursor:default; }
.profile-page :focus-visible,.profile-file:focus-within { outline:2px solid currentColor; outline-offset:3px; }
.profile-page form:not([hidden]) { display:grid; gap:20px; max-width:28rem; margin-top:24px; }
.profile-page form label { display:grid; gap:8px; font-weight:500; }
.profile-page form :is(input,select) { width:100%; min-height:42px; padding:10px 12px; border:1px solid var(--line); background:var(--paper); color:inherit; border-radius:6px; font:inherit; box-sizing:border-box; }
.profile-page form :is(input,select,textarea):focus { border-color:var(--ink); }
.profile-identity,.profile-photo-row,.profile-actions { display:flex; flex-wrap:wrap; align-items:center; gap:.85rem 1.15rem; }
.profile-identity { margin-bottom:1.5rem; }
.profile-identity :is(h1,p) {margin:0;}
.profile-identity > div { min-width:0; max-width:100%; }
.profile-identity h1 { display:flex; flex-wrap:wrap; align-items:center; gap:.25rem .65rem; overflow-wrap:anywhere; }
.profile-photo-row .profile-file { position:relative; overflow:hidden; }
.profile-file input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.profile-portrait { display:inline-grid; vertical-align:middle; place-items:center; width:80px; height:80px; border-radius:50%; object-fit:cover; }
.profile-initial { background:color-mix(in srgb,currentColor 10%,transparent); font-size:1.8rem; font-weight:700; }
.profile-owned { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,9rem),1fr)); gap:1.5rem 1rem; }
.profile-owned-card { display:flex; flex-direction:column; min-width:0; gap:4px; color:inherit; text-decoration:none; overflow-wrap:anywhere; }
.profile-owned-card strong { font-size:15px; font-weight:600; line-height:1.35; }
.profile-owned-card .card-image-slot { border-radius:7px; overflow:hidden; margin-bottom:.3rem; }
.profile-owned-card .card-image-slot>img {width:100%;height:100%;object-fit:contain;border-radius:inherit;}
.profile-owned-card:hover {text-decoration:underline;}
.profile-owned-card small { font-size:12px; line-height:1.45; color:var(--muted); }
.profile-owned + nav { margin-top:1.25rem; }
.profile-page [hidden] { display:none; }

.profile-page > .profile-collection { max-width:none; padding:24px 0 0; border-top:1px solid var(--line); border-bottom:0; margin-top:20px; }
.profile-collection .binder-browse-toolbar { margin:0 0 24px; }
.profile-collection .binder-browse-toolbar h2 { margin:0; }
.profile-page .profile-collection form.binder-search { display:flex; gap:9px; width:min(100%,340px); max-width:none; margin:0 0 0 auto; }
.profile-page .profile-collection .binder-search input { min-width:0; min-height:40px; padding:8px 0; border:0; border-radius:0; background:transparent; outline:none; box-shadow:none; font:400 14px/1.4 var(--sans); }
.profile-page .profile-collection .binder-search button { flex:none; width:30px; min-height:30px; padding:0; border:0; font-size:18px; }
.shared-collection-heading { display:flex; flex-wrap:wrap; align-items:baseline; gap:8px 16px; margin-bottom:24px; }
.shared-collection-heading h3 { margin:0; font-size:22px; font-weight:600; line-height:1.3; letter-spacing:-.025em; }
.shared-collection-heading [data-shared-count] { color:var(--muted); font-size:13px; }
@media (max-width:560px) { .profile-page .profile-collection form.binder-search { width:100%; } .profile-page .profile-collection .binder-search input { font-size:16px; } }

.profile-team-selectors { display:grid; gap:12px; border:0; padding:0; margin:0; min-width:0; }
.profile-team-selectors legend { margin-bottom:12px; font-weight:500; }
.profile-team-selectors label { grid-template-columns:3em minmax(0,1fr); align-items:center; }
.profile-favorite-teams { display:flex; flex-wrap:wrap; gap:.35rem 1.15rem; list-style:none; padding:0; margin:.35rem 0 0; }
.profile-favorite-teams small { color:var(--muted); font-weight:600; margin-right:.2em; }

.photo-editor {
  box-sizing: border-box;
  width: min(350px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
}
.photo-editor::backdrop { background: rgb(10 17 24 / 55%); }
.photo-editor h2 { margin: 0 0 1rem; }
.photo-editor canvas {
  display: block;
  width: min(100%, 42dvh, 256px);
  height: auto;
  margin: auto;
  border-radius: 50%;
  outline: 1px solid var(--line);
  touch-action: none;
  cursor: grab;
}
.photo-editor canvas:active { cursor: grabbing; }
.photo-editor label { display: flex; align-items: center; gap: 16px; margin: 18px 0; }
.photo-editor input { flex: 1; min-width: 0; accent-color: var(--accent); }
.photo-editor-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: end; }
.photo-editor-actions [data-reset] { margin-inline-end: auto; }
.photo-editor-actions [data-save] { background: var(--ink); color: var(--paper); }

.profile-bio,.bounty-list p { white-space:pre-wrap; overflow-wrap:anywhere; }
.profile-identity .profile-bio { margin-top:12px; max-width:60ch; font-size:15px; line-height:1.6; }
.profile-page textarea,.bounty-editor :is(input,textarea) { width:100%; padding:.55rem .7rem; font:inherit; color:inherit; background:var(--surface,Canvas); border:1px solid var(--line); border-radius:7px; resize:vertical; }
.social-actions { display:flex; align-items:center; flex-wrap:wrap; gap:.45rem; }
.social-list { list-style:none; padding:0; margin:0; }
.social-list li { display:flex; justify-content:space-between; align-items:baseline; gap:12px; padding:16px 0; border-bottom:1px solid var(--line); }
.social-list li:last-child { border-bottom:0; }
.social-list li div { min-width:0; overflow-wrap:anywhere; }
.social-list li small { display:block; color:var(--muted); font-weight:400; }
.social-list li b { font-variant-numeric:tabular-nums; }
.social-list li p { margin:.2rem 0 0; }
.social-status:empty { display:none; }
.social-status { overflow-wrap:anywhere; }
.bounty-editor summary { width:fit-content; cursor:pointer; text-decoration:underline; text-underline-offset:.18em; }
.bounty-editor form { display:grid; gap:.65rem; margin:.7rem 0; max-width:24rem; }
.bounty-editor label { display:block; }
.card-bounties button { width:fit-content; padding:.4rem .75rem; font:inherit; border:1px solid var(--line); background:transparent; color:inherit; border-radius:7px; cursor:pointer; }

.profile-page.account-settings {
  max-width: 68rem;
  padding-block: var(--page-inset) var(--page-end);
}
.settings-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.settings-heading h1 { margin: 0; }
.settings-heading a { flex: none; font-size: .9rem; text-underline-offset: 3px; }
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(32px, 5vw, 72px);
}
.settings-layout section { min-width: 0; padding-top: 0; }
.settings-layout h2 { margin: 0 0 20px; font-size: 20px; }
.account-settings .settings-layout form:not([hidden]) { max-width: none; }
.settings-profile .profile-photo-row { gap: 8px; }
.settings-profile [data-portrait] { margin-inline-end: 7px; }
.settings-profile .profile-portrait { display: block; width: 60px; height: 60px; }
.settings-profile .profile-initial { display: grid; font-size: 1.5rem; }
.account-settings .settings-profile form label { font-size: .91rem; }
.account-settings .settings-layout :is(input, textarea, select) { font-weight: 400; }
.settings-profile textarea {
  width: 100%; box-sizing: border-box; padding: .65em .75em;
  border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: inherit;
  font: inherit; font-weight: 400; line-height: 1.45; resize: vertical; min-height: 5.5em;
}
.account-settings .profile-team-selectors label { grid-template-columns: 3rem minmax(0, 1fr); }
.settings-options { display: grid; gap: 28px; padding-left:28px; border-left:1px solid var(--line); }
.settings-options section { display: grid; justify-items: start; align-content: start; gap: 12px; padding-bottom:28px; border-bottom:1px solid var(--line); }
.settings-options section:last-child { padding-bottom:0; border-bottom:0; }
.settings-options h2, .settings-options p, .account-settings .settings-options form:not([hidden]) { margin: 0; }
.settings-options p { color: var(--muted); font-size: 14px; line-height:1.6; }
.settings-options .profile-actions { gap: 8px 14px; }
.settings-options .profile-actions a { font-size: .9rem; text-underline-offset: 3px; }
.settings-options button, .settings-layout .profile-file { font-size: .91rem; }
.account-settings .profile-notice:not(:empty) { margin-top: 16px; }
.settings-collector-count { margin-top: 32px; padding-top:20px; border-top:1px solid var(--line); color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.profile-username,.settings-help,.friends-intro,.friends-empty,.collector-private-note { color:var(--muted); font-size:.9rem; }
.profile-page .profile-username { margin-top:.2rem; }
.account-settings .settings-help { margin:-12px 0 0; font-size:13px; line-height:1.55; font-weight:400; }
.settings-checkbox { display:flex; align-items:flex-start; gap:9px; font-size:.92rem; cursor:pointer; }
.settings-checkbox input { flex:none; width:16px; height:16px; margin:3px 0 0; accent-color:var(--accent); }
.profile-page .collector-search:not([hidden]) { grid-template-columns:minmax(0,1fr) auto; align-items:end; max-width:25rem; gap:8px; margin-block:20px; }
.collector-search label { min-width:0; }
.profile-page .collector-search input { min-height:38px; padding:.45em .7em; }
.collector-search button { min-height:38px; }
.collector-friends h2 { margin-bottom:.5rem; }
.friend-group { margin-top:1.5rem; }
.friend-group h3 { font-size:1rem; margin:0 0 .4rem; }
.friend-group h3 small { margin-left:.25rem; color:var(--muted); font-size:.8rem; font-weight:400; }
.collector-friends .social-list li { align-items:center; flex-wrap:wrap; }
.friend-person { display:flex; align-items:center; gap:10px; }
.friend-person > div { min-width:0; }
.friend-person .collector-avatar-link { flex:none; }
.collector-friends .friend-message { display:inline-flex; align-items:center; justify-content:center; min-height:36px; padding:.55em .9em; border:1px solid var(--line); border-radius:8px; font-size:.88rem; color:inherit; text-decoration:none; }
.collector-friends .friend-message:hover { background:color-mix(in srgb,currentColor 6%,transparent); }
.collector-search-results { border-top:1px solid var(--line); }
.friend-requests-off { color:var(--muted); font-size:.85rem; }
.collector-private-note { margin-block:0 1rem; }
.profile-dashboard {
  display:grid;
  grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);
  align-items:start;
  gap:24px clamp(32px,5vw,64px);
}
.profile-dashboard > .profile-identity {
  grid-column:1 / -1;
  margin:0;
  padding-bottom:24px;
  border-bottom:1px solid var(--line);
}
.profile-dashboard > .profile-actions { grid-column:1 / -1; gap:8px; padding-bottom:4px; }
.profile-dashboard > .profile-actions a {
  display:inline-flex;
  align-items:center;
  min-height:36px;
  padding:7px 13px;
  border:0;
  border-radius:6px;
  background:var(--surface);
  font-size:14px;
  font-weight:500;
  text-decoration:none;
}
.profile-dashboard > .profile-actions a:hover { background:var(--surface); }
.profile-page.profile-dashboard > section {
  min-width:0;
  max-width:none;
  margin:0;
  padding:20px 0 0;
  border-top:1px solid var(--line);
  border-bottom:0;
}
.profile-dashboard h2 { font-size:20px; }
.profile-dashboard .collector-search label { font-size:.9rem; }
.profile-dashboard :is(.social-actions button,.collector-search button) { font-size:.88rem; }
.profile-dashboard .friend-group { margin-top:24px; }
.profile-dashboard .friend-group h3 { font-size:14px; font-weight:600; padding-bottom:8px; border-bottom:1px solid var(--line); }
.profile-dashboard .friends-empty,.profile-dashboard .bounty-empty { margin-bottom:0; color:var(--muted); font-size:.9rem; }
@media (max-width:780px) {
  .profile-dashboard { grid-template-columns:minmax(0,1fr); gap:20px; }
  .profile-dashboard > .profile-identity { padding-bottom:20px; }
  .profile-dashboard .collector-search input { font-size:16px; }
}
@media (max-width: 700px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .settings-options { gap: 24px; padding-left:0; border-left:0; }
  .settings-layout section { padding-top: 20px; border-top:1px solid var(--line); }
  .settings-layout .settings-profile { padding-top:0; border-top:0; }
  .settings-options section { padding-bottom:0; border-bottom:0; }
  .account-settings .settings-layout :is(input, textarea, select) { font-size: 16px; }
}
