[data-accent="lilac"] { --profile-accent: #d3b6ea }
[data-accent="mint"] { --profile-accent: #a7d6bc }
[data-accent="amber"] { --profile-accent: #e6c28a }
[data-accent="ice"] { --profile-accent: #a7cbe9 }

#member {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 11px 3px 4px;
  border: 1px solid #d5c7e42e;
  background: #e4d7f00b;
  min-width: 40px;
  max-width: min(32vw, 215px);
}
#member:hover { background: #e4d7f019 }
.profile-member-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis }
.frame:has(#member:not([hidden])) { grid-template-columns: minmax(0, 1fr) }
.topbar:has(#member:not([hidden])) { min-width: 0 }
.topbar nav { min-width: 0; justify-content: flex-end }
#ownerPanel {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 36px;
  padding: 4px 11px;
  border: 1px solid #d5c7e42e;
  border-radius: 10px;
  color: #e8dfef;
  white-space: nowrap;
}
#ownerPanel:hover { background: #e4d7f019 }
.profile-mini, .profile-picture {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  overflow: hidden;
  border: 1px solid var(--profile-accent, #d3b6ea);
  border-radius: 50%;
  background: #2e2a35;
  color: var(--profile-accent, #d3b6ea);
  font-weight: 600;
}
.profile-mini { width: 28px; height: 28px; font-size: 13px }
.profile-mini img, .profile-picture img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #2e2a35;
}
#siteProfile {
  width: min(425px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  overscroll-behavior: contain;
  background: linear-gradient(140deg, #302a36, #1a171f 56%);
  box-shadow: inset 0 1px 0 #f6e5ff26, 0 18px 80px #0009;
}
.profile-heading, .profile-picture-row, .profile-file-controls, .profile-actions {
  display: flex;
  align-items: center;
}
.profile-heading { justify-content: space-between; gap: 12px; margin-bottom: 20px }
.profile-heading h2 { font-size: 24px; letter-spacing: -.025em }
#profileLogin { margin: 4px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere }
.profile-close, .profile-secondary {
  border: 1px solid #d4c7df38;
  border-radius: 10px;
  background: #d7c6e60d;
}
.profile-close { width: 40px; height: 40px; font-size: 22px; background: transparent }
.profile-secondary { min-height: 36px; padding: 5px 12px; font-size: 13px }
.profile-close:hover, .profile-secondary:hover { background: #d7c6e620 }
.profile-fields, .profile-colors { margin: 0; padding: 0; border: 0; min-width: 0 }
.profile-fields { display: grid; gap: 17px }
.profile-picture-row {
  gap: 14px;
  padding: 2px 0 18px;
  border-bottom: 1px solid #d4c7df25;
}
.profile-picture { width: 65px; height: 65px; font-size: 27px }
.profile-upload-actions { min-width: 0 }
.profile-file-controls { gap: 8px; flex-wrap: wrap }
.profile-text-button { background: transparent; padding: 5px; font-size: 12px; color: var(--muted) }
.profile-text-button:hover { color: var(--text) }
#profileFileHint { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere }
.profile-field { display: block; position: relative; font-weight: 550 }
.profile-field input, .profile-field textarea {
  display: block;
  width: 100%;
  background: #111015;
  border: 1px solid #d8cde238;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 6px 0 0;
  font: 400 14px/1.45 Golos, Arial, sans-serif;
}
.profile-field textarea { min-height: 68px; resize: vertical }
.profile-field textarea:focus-visible { outline: 2px solid var(--profile-accent); outline-offset: 3px }
#profileCount { position: absolute; top: 0; right: 0; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums }
.profile-colors legend { color: #ddd5e6; font-size: 13px; font-weight: 550; padding: 0; margin-bottom: 8px }
.profile-swatches { display: flex; flex-wrap: wrap; gap: 6px }
.profile-swatches label { position: relative; cursor: pointer }
.profile-swatches input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  clip-path: inset(50%);
  overflow: hidden;
  margin: 0;
  padding: 0;
}
.profile-swatches span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid #d1c5db30;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
}
.profile-swatches span::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--profile-accent) }
.profile-swatches input:checked + span { color: var(--text); border-color: var(--profile-accent); background: #ece5f010 }
.profile-swatches input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px }
.profile-feedback { margin: 5px 0 0; font-size: 12px; color: #e4d6eb; line-height: 1.5 }
.profile-feedback:empty { display: none }
.profile-actions { justify-content: flex-end; gap: 8px; margin-top: 10px }
.profile-actions .light { min-height: 42px; padding: 8px 18px; border-radius: 11px }
.account-ref {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #d4c7df25;
  font-size: 12px;
  color: var(--muted);
}
.account-ref summary { width: fit-content; padding: 3px 0; cursor: pointer }
.account-ref summary:focus-visible { outline: 2px solid var(--profile-accent); outline-offset: 3px }
.account-ref code { display: block; margin: 9px 0 6px; overflow-wrap: anywhere; color: var(--text); user-select: all }
.account-ref button { padding: 6px 9px; color: var(--text); border-radius: 7px; background: #d7c6e617; font-size: 12px }
.account-ref button:hover { background: #d7c6e629 }
@media (max-width: 460px) {
  #member { max-width: min(32vw, 116px); padding-right: 7px; gap: 5px }
  #ownerPanel { padding-inline: 6px; min-height: 32px }
  .topbar:has(#ownerPanel:not([hidden])) { gap: 6px }
  .topbar:has(#ownerPanel:not([hidden])) #logout { padding-inline: 6px }
  #siteProfile { padding: 19px }
  .profile-fields { gap: 14px }
  .profile-field input, .profile-field textarea { font-size: 16px }
}
@media (max-width: 350px) {
  .profile-mini { width: 24px; height: 24px }
  .profile-picture { width: 47px; height: 47px }
  .profile-picture-row { gap: 10px }
}
@media (max-width: 420px) {
  .topbar:has(#ownerPanel:not([hidden])) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 5px;
  }
  .topbar:has(#ownerPanel:not([hidden])) nav { display: contents }
  .topbar:has(#ownerPanel:not([hidden])) .brand { grid-area: 1 / 1; justify-self: start }
  .topbar:has(#ownerPanel:not([hidden])) #logout { grid-area: 1 / 2; justify-self: end }
  .topbar:has(#ownerPanel:not([hidden])) #member { grid-area: 2 / 1; justify-self: start; max-width: 100% }
  #ownerPanel { grid-area: 2 / 2; justify-self: end }
}
